This is something I wrote for myself, to use on a server that I manage where the users have cryptic usernames, and I'd like to tag them with clear text.
I'll modify it in the future to parse /etc/password which is the database where this information is from (which is a better way to achieve this).
Add the following line to your .bashrc to check it out:
function fingr() { sudo printf "User Name [$1]:" && sudo printf "\n\n\n\n\n" | sudo chfn $1 | grep : ; }
The idea to write something like that came after reading this post (I'm not affiliated):
http://shinnok.com/rants/2013/09/18/alternative-to-the-finger-unix-command
$ fingr root
User Name [root]: Full Name [Mr. Root]: Room Number []: Work Phone [555-GOT-ROOT]: Home Phone [] Other [Root account]:
Show Sample Output
For example, if you have a locally hosted git server, plus github, plus gitlab.
...changes modify time and access time. also: touch -r [file1] [file2] # make file2 timestamp match file1
Using perl, here, we grep the man page of fetchmail to find the paragraph starting with '-k | --keep' and ending before the paragraph starting with '-K | --nokeep' Show Sample Output
This command will print all fields from the given input to the end of each line, starting with the Nth field.
after installing new fonts ( tfm , pfb , cjk , truetype ... ) manually in your ~/.Texmacs/fonts , it doesn't always reload it properly , just refresh it by delete the old cache fonts in sample output , I just installed TrueType Chinese CJK fireflysung fonts supports Show Sample Output
A really useful pair of du options. Show Sample Output
This is similar to using `!!` or In bash 4.1 it seems you can bind directly to a shell command, but I'm not running that version. Show Sample Output
Requires 'reflector' package from official repository. '5' in the example is the number of mirrors you want in the mirrorlist, could be other numbers of course.
The command will make it easy to determine free IP ranges in a crowded sub-net. Show Sample Output
Get the amount of physical memory in an HP-UX v11 OS when following are NOT available: - root account - no privileges in /proc - no privileges in /dev/mem Show Sample Output
list all java process info.
This is used during pentest to quickly poll all the processes running on a set of systems you have common credentials for the /FAILFAST:ON speeds up the scans. Show Sample Output
Silent:
anywait () { for pid in "$@"; do while kill -0 "$pid" >/dev/null 2>&1; do sleep 0.5; done; done }
Prints dots:
anywaitd () { for pid in "$@"; do while kill -0 "$pid" >/dev/null 2>&1; do sleep 0.5; echo -n '.'; done; done }
Prints process ids:
anywaitp () { for pid in "$@"; do while kill -0 "$pid" >/dev/null 2>&1; do sleep 0.5; echo -n $pid' '; done; echo; done }
You cannot anywait for other users processes.
Show Sample Output
Produces the same, but without current directory size (.).
This command tars/gz all the folders contained in a directory. Only applies to top level directory. Very handy when you have to transfer mny folders containing lots of stuff. Can also work with tar only, zip...
Replace video and audio extension according to your needs
Dumping man pages to text typically retains certain formatting such as foo^H^H^H___ for underscoring, and reverse-line feeds (not sure why). 'col -bx' removes these. Show Sample Output
This will print to the screen password for the user specified in "sys_users.login='xxxx';. This is for Plesk servers only. 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: