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

Which processes are listening on a specific port (e.g. port 80)
swap out "80" for your port of interest. Can use port number or named ports e.g. "http"

Redirect tar extract to another directory
The command extracting the tar contents into particular directory ...

Print trending topics on Twitter

Dump snapshot of UFS2 filesystem, then gzip it
Opens a snapshot of a live UFS2 filesystem, runs dump to generate a full filesystem backup which is run through gzip. The filesystem must support snapshots and have a .snap directory in the filesystem root. To restore the backup, one can do $ zcat /path/to/adXsYz.dump.gz | restore -rf -

Search for files older than 30 days in a directory and list only their names not the full path

Delete Empty Directories
Deletes empty directories and prints an error if directory is not empty.

determine if tcp port is open
Requires netcat.

Watch active calls on an Asterisk PBX
This handles when you have a single call or channel. Other commands will strip out the result if there is a single channel or call active because the output changes the noun to be singular instead of plural.

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

copy from host1 to host2, through your host
Good if only you have access to host1 and host2, but they have no access to your host (so ncat won't work) and they have no direct access to each other.


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: