I often forget to type sudo before a command that needs it. This is the quickest way to rerun the command prefixed by sudo.
Print "Art of hacking..." 100 times by perl or you can this tools : http://packetstormsecurity.org/shellcode/shellcodeencdec.py.txt Show Sample Output
I absolutely love this website, and appreciate every contribution. This is the first place I go when I'm stuck, you all have some great ideas. But contributions seem to be slipping a little. If all of us could contribute more code from time to time, this site would be absolutely incredible. Since I'm a relative newcomer to commandline-fu, I don't have the knowledge to contribute much, but I will do what I can.
The script contains a single command: cd /a/long/directory/path/i/can/never/remember
Simply copies your public key to the remote system. For the first time, this will require a password for the user@remote account. From then on, ssh will ask for your private key keyphrase occasionally but you won't need to use the password. Very handy when you're moving files for testing etc.
get cpu info from dmesg
عرض الاتصالات لبورت ٢٢
( IFS=:; for i in $PATH; do echo $i; done; ) echo $PATH|sed -e 's/:/\n/g' # but the tr one is even better of course echo $PATH|xargs -d: -i echo {} # but this comes up with an extra blank line; can't figure out why and don't have the time :( echo $PATH|cut -d: --output-delimiter=' ' -f1-99 # note -- you have to hit ENTER after the first QUOTE, then type the second one. Sneaky, huh? echo $PATH | perl -l -0x3a -pe 1 # same darn extra new line; again no time to investigate echo $PATH|perl -pe 's/:/\n/g' # too obvious; clearly I'm running out of ideas :-)
In my work environment, we log onto the servers as our user ('user', in the sample ouput), and 'sudo su - root' to other accounts. This trick allows us to return the account name we logged in as -- and not the account name we currently are ('root', in this example).
Using this trick, you can build other commands:
Set your CVSROOT env variable to your account name:
CVSROOT=$(who am i | awk '{print $1}')@cvs.server.example.com:/cvsroot
SCP a file to another server:
scp file.txt $(who am i | awk '{print $1}')@some.other.server.com:.
This works out great in my environment, as we can include this in our documentation and make the comands more easy to copy/paste for different users, and not have to set all sorts of variables, or modify the docs for each user.
whoami gives you the name of the user you currently are, not the user you logged on originally as.
who gives you a listing of every single person logged onto the server.
who am i gives you the name of the user you logged on as, and not who you changed to with su.
Look at the following scenario:
whoami
user
su -
# whoami
root
# who am i
user pts/51 2009-02-13 10:24 (:0.0)
whoami != who am i
Show Sample Output
ghgh rty uty tr uyuyuyu
It will list all files in your home directory even if your current directory is not home directory Show Sample Output
add (server-start) in .emacs
This open the cd rom device and close it in a loop
alias for editing .bashrc and sourcing it with a quick command, very useful for quickly adding and modifying alias' and functions in bashrc, create lots of alias from commandlinefu very quickly, use nano vim or any other edit if you want, very useful if you have a barcode scanner and you want to run commands quickly with barcodes Show Sample Output
When you have to manage lot of servers, it's boring to type ssh root@myhost for each connection. Now you can type juste "s someting" and you are connected. You can too add bash_completion script to complet with tab the name of your servers. This will be the next tips from me ;) 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: