Commands using cd (215)

What's this?

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.

Share Your Commands


Check These Out

Fetch the Gateway Ip Address
This is to fetch the Gateway Ip Address of a machine. Use the below format to put the value in a variable if you wish to find the gateway ip in a script $GATEWAY=$(netstat -nr | awk 'BEGIN {while ($3!="0.0.0.0") getline; print $2}')

Convert CSV to JSON
Replace 'csv_file.csv' with your filename.

"Clone" a list of installed packages from one Debian/Ubuntu Server to another

Write comments to your history.
A null operation with the name 'comment', allowing comments to be written to HISTFILE. Prepending '#' to a command will *not* write the command to the history file, although it will be available for the current session, thus '#' is not useful for keeping track of comments past the current session.

Clear mistyped passwords from password prompt
Type ^u at password prompt to clear a mistyped password.

Backup a file with a date-time stamp
$ buf myfile.txt This is useful when you are making small but frequent changes to a file. It keeps things organised and clear for another administrator to see what changed and at what time. An overview of changes can be deduced using a simple: $ ls -ltr

List docker volumes by container

clean up memory on linux
where proc filesystem mounted under /proc

prints the parameter you used on the previous command

Alias for quick command-line volume set (works also remotely via SSH)
If you're addicted to command-line solutions of ordinary actions or if you just want to set your volume from bed via mobile phone SSH, you can set this alias and use it as $ setvol 50 for setting volume on 50% gain Works only with ALSA, tested on Ubuntu 8.10. Give me some info about your experience. TIP: Try aslo command "mute" to toggle mute/unmute sound. But I don't know if this works on all distros.


Stay in the loop…

Follow the Tweets.

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

Subscribe to the feeds.

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: