- Articles
19 results
-
Force exit code 0
To force a command to return success, for example, an rm command that might fail but you don't care if it does, just add'||:' to the end rm nonexistantfile.txt||: This will force an -
Harvest adding ^M to files
In case you got problems with Harvest, this link might help you There's the full version in case you dont have a PDF viewer. Getting rid of unwanted^M character Posted by Ken Strobel -
Obtain a complete xml tag
This is an example XML file?xml version="1.0"? catalog book id="bk101" authorGambardella, Matthew/author titleXML Developer's Guide/title genreComputer/genre price44.95/price publish_date2000-10-01/publish_date descriptionAn in -
Search for ^M in files
When editing files in Windows, the resulting files will have^M control characters. Most of the time, this will render the file useless on Unix You can solve that easily using the dos2unix (or dos2ux -
Obtaining lines from a text file where a column has some value
You have file comma separated values. You need certain rows where a(some) specific column(s) has some value. awk -F',''($3~ "VALUE"){print$3}' File.csv awk -F',''($3~ "VALUE"){print$0}' File.csv awk -F -
How to know column headers positions
Use this perl command perl -e'{$file="test.txt";$lin=1;$sep=";"} print++$i."\t$_$/"foreach(split/$sep/,qx[head -$lin$file|tail -1])' Given a file with this text on the 1st line: Name -
X11 Forwarding
Run ssh -X user@remoteip ↑ https://security.stackexchange.com/a/14817/147346 -
Installing CPAN module with all dependencies
To stop CPAN from asking'yes/no' when installing a module, use this command. PERL_MM_USE_DEFAULT=1 perl -MCPAN -e'install My::Module' (Works in bash only) -
Append newline to files with incomplete last line
tail -1c FileName.ext| wc -l echo FileName.ext -
NFS on a VPS
You can't use regular NFS on a Virtual Private Server. For that, you must use UNFS. Install UNFS and configure NFS normally. -
Is my Solaris machine 32 or 64 bit?
Execute this command/usr/bin/isainfo -b -
Which directory is heavier
If you have lots of directories and want to know which one is heavier (has more MB of data) just use du (disk usage) Example dir_A+---A1+---A2+---A3+---B1 -
Unzip and CPAN
If you receive the following message in CPAN Cannot unzip, no unzip program available On a Debian based system, follow these steps to solve it sudo apt-get install unzip, whereis unzip (write down this -
Find how much space is used by a directory
Go to the directory you want to weight with cd commands. And then execute. du -h -
How to fix numpad in ubuntu when it stops working
Ubuntu users (and possibly other GNOME users): Has your numpad randomly stopped working? This has happened to me, and a number of other Ubuntu users. It's really easy to fix. Go to System - Preferences -
Changing directories
cd:Go to your$HOME directory, cd -: (cd, space, and a dash) Go to the previous directory. (like going back in history in a browser), pushd directory:Store directory in a stack, popd:Pop a directory -
Determine if a file exists
The unix command test allows you to do that, among other things test -e Filename&& echo'YES'|| echo'NO' In my case, i tried to make a file list in a text file and check -
Perform a task on a whole directory
Those commands will work on the current dir and the subdirs too. find. -print| xargs digest -a md5 find. -print| egrep -v'^\.$'| xargs digest -a md5 find. -print| xargs touch -
Unix Wiki
Got a nice one-liner or tips? Put them here! Use this link to start creating articles. LIST OF ALL ARTICLES
Related Community

Marvel Database
comics
200K
Pages200K
Images1K
Videos
With more than 200,000 articles, the Marvel Database is the largest Marvel Comics encyclopedia ever written, as well as being the 5th largest FANDOM wiki. The database covers comics, characters, teams, games, TV shows and movies. Browse one of over…