Returns the IP, broadcast, and subnet mask of your interfaces absent any other extraneous info. I know it's a bit lame, but I've created an alias for this when I *quickly* want to know what a system's IP is. Small amounts of time add up :) Show Sample Output
This is just a quick and dirty way to play remote audio files *locally* in your PC. The best way is to mount the remote Music directory into the local FS, say by using sshfs: sshfs user@remote:/remote/music/dir/ /mnt/other_pc/
Another alternative to blkid, lsblk, file -s, cat /proc/paritions, fdisk -l, etc.. Show Sample Output
I don't like doing a massive sort on all the directory names just to get a small set of them. the above shows a sorted list of all directories over 1GB. use head as well if you want. du's "-x" flag limits this to one file system. That's mostly useful when you run it on "/" but don't want "/proc" and "/dev" and so forth. Remember though that it will also exclude "/home" or "/var" if those are separate partitions. the "-a" option is often useful too, for listing large files as well as large directories. Might be slower.
The above is OK if you not worried about security, as per sshpass man pages: " The -p option should be considered the least secure of all of sshpass's options. All system users can see the password in the command line with a simple "ps" command." So, instead what I do is use the -e option: " -e The password is taken from the environment variable "SSHPASS"." Show Sample Output
How to figure out what a program is doing. -tt detailed timestamps -f also strace any child processes -v be very verbose, even with common structures -o write output to file -s N capture up to N characters of strings, rather than abbreviating with ...
RU: Найдет число файлов в папке по данной маске в цикле по дням месяца
Replace
'/tmp/file 1.txt' '/tmp/file 2.jpg'
with
"$NAUTILUS_SCRIPT_SELECTED_FILE_PATHS"
for Nautilus script
Or with
%F
for Thunar action
If you linking the symlinks itself, but want to link to source files instead of symlinks, use
"`readlink -m "$i"`"
instead of
"$i"
like this:
for i in '/tmp/file 1.txt' '/tmp/file 2.jpg'; do ln -s "`readlink -m "$i"`" "$i LINK"; done
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Show Sample Output
Info about Bluetooth devices. Show Sample Output
Credit for the awk command goes to: http://www.cyberciti.biz/faq/howto-move-migrate-user-accounts-old-to-new-server/
Useful for testing domain authentication through a Linux server Show Sample Output
use -xcvf to decompress
Useful if localhost is a small machine running BusyBox, which uses a slightly unusual format to set the date. Remotehost can be pretty much any Linux machine, including one running BusyBox. Uses UTC for portability.
Connects to the last adb connection in history. Show Sample Output
In a multiple PostgreSQL server environment knowing the servers version can be important. Note that psql --version returns just the local psql apps version which may not be what you want. This command dumps the PostgreSQL servers version out to one line. You may need to add more command line options to the psql command for your connection environment. Show Sample Output
-t, --tuples-only print rows only Show Sample Output
Without using a pipe. -X ignores the user's .psqlrc configuration file -A sets un-aligned table output mode -t prints rows only (no headers or footers) Show Sample Output
This find syntax seems a little easier to remember for me when I have to use -prune on AIX's find. It works with gnu find, too. Add whatever other find options after -prune Show Sample Output
Accepts multiple files via logs...
. Substitute "text to grep" for your search string.
If you want to alias this, you could do something like this:
alias parse-logs='awk "/$1/{print \$1}" ${@[@]:1} | sort -n | uniq -c | sort -rn | head -n 100'
requires superuser privileges
requires su privileges 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: