works only in zsh, requires EXTENDED_GLOB to be set.
Cleaner than adding -p to ls ( eg ls -alp ), this will tell ls to only output directories in the file listing, whilst maintaining all the usual other column elements of the ls output.
ls -al gives all files, sort +4n sorts by 5th field numerically
This requires a version of GNU find that supports the -exec {} + action, but it seems more straightforward than the versions already posted. Show Sample Output
Code to delete file with gremlins/special characters/unicode in file name. Use ls -i to find the INODE number corresponding to the file and then delete it using that find statement. detailed here: http://www.arsc.edu/arsc/support/howtos/nonprintingchars/ Show Sample Output
In the example suppose we want to move all *.rar files in the current folder to a backupfolder
Accidentally deleted some file while used by a program ? (Eg: a song)
Use this command to find the file handle and recover using
cp /proc/pid/fd/filehandle /new/recoverd-file.ext
Show Sample Output
Pretty lame to rely on grep and "\->"? Maybe. But it works ;) Show Sample Output
Changes dir to $1 and executes ls. As simple as useful Show Sample Output
svn must be 1.7
works nice if you're only interested in files that are completed downloading from a torrent
Executing pfiles will return a list of all descriptors utilized by the process We are interested in the S_IFREG entries since they are pointing usually to files In the line, there is the inode number of the file which we use in order to find the filename. The only bad thing is that in order not to search from / you have to suspect where could possibly be the file. Improvements more than welcome. lsof was not available in my case 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: