After you execute a command (or shell script) in the background using &, if you logout from the session, the command will get killed. To avoid that, you should use nohup as shown below.
Convert long list of ' ' to a single space. Compress space and other characters. Show Sample Output
Display the 1st field (employee name) from a colon delimited file Show Sample Output
The following displays only the entries that are duplicates. Show Sample Output
Uniq command is mostly used in combination with sort command, as uniq removes duplicates only from a sorted file. i.e In order for uniq to work, all the duplicate entries should be in the adjacent lines. Show Sample Output
ls -al gives all files, sort +4n sorts by 5th field numerically
Sort using kth column using : delimiter
Translates first set into second set Show Sample Output
Join command combines lines from two files based on a common field. Show Sample Output
This will be very helpful when you are debugging shell scripts, where you don?t want to display the echo statement and interested in only looking at the error messages. Similarly use 2> to supress error messages Show Sample Output
This pattern matches empty lines in the file and -c gives the count
Use shopt -s cdspell to correct the typos in the cd command Show Sample Output
manage directory stack Show Sample Output
switch to previous directory or toggle
Creates a directory and then cds into it directly Show Sample Output
While logged into ssh, type ~s to see stats of ssh
Suspend ssh session Show Sample Output
Sometimes it is necessary to view debug messages to troubleshoot any SSH connection issues. pass -v (lowercase v) option to the ssh as shown below to view the ssh debug messages. Show Sample Output
commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.
Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.
» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10
Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):
Subscribe to the feed for: