10 Linux shell tricks you don’t already know. Really, we swear.
Rescued from Google page as site seems to be down. This information is gold. So it is republished from:
http://209.85.165.104/search?q=cache:http://www.venturecake.com/10-linux-shell-tricks-you-dont-already-know-for-once/
The original link therefore is: http://www.venturecake.com/10-linux-shell-tricks-you-dont-already-know-for-once/
———————————————————————————————————
Yeah, I’ve read them too. Lists of shell tricks you already know – pstree (wow!) bc (bash already has built-in math), and a dozen commands you see in every Linux site, book, and training course.
Here’s a list of damn useful commands you haven’t heard before.
1. A Simple way to Send Output and Errors
Want to send output and errors to the same file?
command &> file
Maybe you’re troubleshooting a problematic app with strace, and want to see the system calls at the same time as the apps errors?
strace badapp &> errors_and_output
Benefit: Easy to remember, and simpler than ’send errors to output, and then send that to a file’
Works in: any currently supported Linux
2. Parallelize Your Loops
Almost every Linux network administrator knows the power of the for loop: the way to do something for one, one hundred or one thousand users, files, machines, processes, or whatever else. Most people set their loops in sequence – so that each jobs is finished before moving onto the next.
But the jobs command can be used to background each loop, so you don’t have to wait for it to complete before continuing with the next.
Here’s an example running an apt-get update:
for HOST in $(< ListOfHosts); do ssh $HOST ’sudo apt-get update’ & done
Maybe you need a bunch of SSH tunnels running simultaneously:
for HOST in $(< ListOfHosts); do ssh -C -N -R 80:localhost:80 $HOST & done
Sometimes you probably don’t want to see all the output as it happens – in that case, save a file on each machine and use another loop to collect it later.
Benefit: Saving a metric shitload (2/3rd of an imperial shitload) of time waiting on stuff to finish
Works in: any currently supported Linux
Drawbacks: Bash probably has some limits of the amount of concurrent jobs. But I’ve yet to run into them.
3. Catch Memory Leaks By Using Top via Cron
Memory apps are rare in Linux, but they do happen, particularly when using beta distros or home grown software. A lot of time the identitty of the app with a memory leak isn’t that apparent. Linux has an Out-Of-Memory app built in to identify and kill these apps, but by the time it eventually kicks on your system may have been unusually slow for a while – and that’s if your patience hasn’t already worn thin and you’ve rebooted.
The normal way to find an apps memory consumption is by running top (or one of it’s graphical equivalents, like System Monitor) and check the Resident Set Size (called Res or RSS) of the processes you care about (you can ignore figures for how much memory the app has allocated – memory leaks come from usage, not allocation, and apps can assign bucketloads of memory they don’t use without hurting your system). Most people aren’t aware top can be run non-interactively, which means you can use cron and top to generate a simple report of an apps usage over time.
- Run top.
- Use the < and > keys until processes are sorted by RES (resident memory usage).
- Hit W to write your config out to a file
- Add a cron job:
crontab – <<< ‘*/15 * * * * top -n 1 -b’
You’ll now get an email every 15 minutes with the top output.
Benefit: way less complicated than adding software like SAR
Works in: any currently supported Linux
Drawbacks: Has some limitations of the amount of concurrent jobs.
4. Standard in directly from the command line
Wondering what the hell the <<< above was? Bash allows you to send programs stdin directly from the command line.
Benefit: Let’s you write your command on the goddamned commandline, even for weird creepy programs that want you to do everything via standard in. Shakes fist at MySQL.
Works in: Bash 3 and newer.
Drawbacks: Still quite a few Bash 2.x systems out there.
5. Set a Random Initial Password, That Must be Changed
There’s a lot of organizations who have nice, secure policies for passwords. Passwords stored on Windows machines. Linux is either not covered by the policy or the policy is routinely violated – people have idea about Linux authentication (most people don’t quite understand PAM, and Linux admins don’t often realize Linux can quite happily authenticate to Active Directory) and once upon a time, the OpenSSH developers didn’t like PAM (that’s since changed).
To set password that must be changed upon first login.
umask u=rw,go=
openssl rand -base64 6 | tee -a PasswordFile | passwd –stdin joe
chage -d 0 joe
The password is saved to PasswordFile , which only your own account can read. Then contact via some medium you consider relatively secure – like a phone call or encrypted email and them tell their initial password.
Benefit: Ensures users aren’t using your default password forever
Works in: any currently supported Linux where OpenSSH has been updated (if your users use SSH to do their first login). Red Hat still say this doesn’t work in the RHEL 3 / 4 documentation, but with their own updates applied, it’s AOK.
Drawbacks: None
6. Add Your Public Key to Remote Machines the Easy Way
In order to perform key based logins to a new machine, you need to get a copy of a public key to the remote machine yourself. Sure, you could do this manually – which gets a bit boring after a while (why doesn’t SSH have an authorized_keys.d anyway?), but why waste time when SSH comes with it the tool to do it?
Just run:
ssh-copy-id -i .ssh/id_rsa.pub hostname
After being prompted to enter your password for the last time, SSH will say:
Now try logging into the machine, with “ssh ‘hostname’”, and check in:
.ssh/authorized_keys
to make sure we haven’t added extra keys that you weren’t expecting.
Try it. No more passwords!
7. Extract an RPM without any additional software
This one isn’t necessary on Debian based distros, as .deb are merely ar archives. Every Red Hat guide ever written mentions using rpm2cpio (which comes as part of the default rpm package), but frankly I can never be bothered remembering the weird syntax to cpio, the ancient archive format used by …uh, pretty much just rpm.
The following command installs a package to a temporary directory, and but doesn’t modify your RPM database (just one in the temporary directory, whose contents you can delete afterward). Since the temp directory doesn’t have any othr software in it, we also disable dependencies and scripts.
mkdir /tmp/deleteme
rpm -ivh –root /tmp/deleteme –nodeps –noscripts package.rpm
8. See How a File Has Changed from Factory Defaults
This is a simple troubleshooting tool when you’re not sure how a file has changed from its defaults. First identify the package that owns the file:
dpkg -S /etc/foo/foo.conf
rpm -qf /etc/foo/foo.conf
Then extract the original package either with tar (DPkg) or the rpm trick above (RPM) and run:
diff /etc/foo/foo.conf /tmp/deleteme/etc/foo/foo.conf
And see the differences.
Benefit: Faster troubleshooting of bad config files (note strace is also handy in these cases)
Works in: any currently supported Linux
Drawbacks: You have more time free at work, to spend reading Digg.
9. Undo Your Network Screwups After You’ve Lost the Connection
Messing with a firewall or a network over a remote connection? Nerve wracking isn’t it? Change the wrong setting and you’ll be locked out, unable to fix it.
So why not undo your mistake? Schedule a job to run at a later time that undoes what you’re about to do.
at now + 5 minutes <<< ‘cp /etc/ssh/sshd_config.old /etc/ssh/sshd_config; service sshd restart’
If you screw up, the job will run and restore things to the way they were.
If you your change works, then just run atq to check the queue of upcoming at jobs, and atrm jobNumber to remove it.
Benefit: Gets you back in after you lock yourself out.
Works in: any Linux provided atd is enabled – which is usually the case.
Drawbacks: Remembering to do it before you make the risk change.
10. Check a Port is Open
Want to check whether a network service is running before you use it? Netcat can be used to easily connect to ports, and has a rather handy wait -w option to tell it how long to wait for.
nc -w 3 server ssh <<< ‘ ‘
Would connect to the ssh port on a machine called server, and wait for up to 3 seconds before sending it, er, nothing, and closing the connection. Whether the port was open will be reflected by nc exit status.
if nc -w 3 localhost 22 <<< ‘’ &> /dev/null
then
echo ‘Port is open’
else
echo ‘Port is closed’
fi
Here’s a few bonus tricks, which you may already know…
Bonus Trick 1: The Easy Way to Extract Tar Archives
New to Linux? Don’t feel like using File Roller to extract archives? Despite everything you rad on the internet, tar (the tape archiver – that why you have to tell it you want to use a file with -f) doesn’t need you to specify archive file formats any more. To extract a file, simply:
tar -xf archive.tgz
But keep reading…
Benefits: No stupid messages from a computer asking for information the computer can determine on its own.
Works in: Recent distros (last year) only
Drawbacks: It’s still to early to use this in a lot of distros.
Bonus Trick 2: Use Math Shells
Most of you already know this, but since digg.com keeps linking to articles about ‘bc’, it’s worth pointing out that Bash comes with it’s own math shells. These can be invoked like an ordinary subshell, but by using two round brackets. Say you have a n script that needs to figure out disk space.
SIZE_IN_KB=204535848
SIZE_IN_GB=$(( $SIZE_IN_KB / 1024 / 1024 ))
echo $SIZE_IN_GB
Benefit: No need for an extra process like bc every time you need to work with number
Works in: any currently supported Linux.
Drawbacks: If you want to do floating point or other advanced math, you’ll probably want to bust out python.
Bonus Trick 3: Never reboot a system for NFS failures
OK, this isn’t a shell trick. It’s more of a general thing for NFS that not enough people know. We’ve included it here because VentureCake loves you.
At some point every Linux admin has had a problem with a computer using a hard-mounted NFS export, where the connecton to the server has been lost – perhaps the network had a problem or the server went down. Any processes which check the status of filesystems – df, rpm, etc. – will hang, waiting on the storage to respond. Next time, you’ll want to mount using the intr option (not soft – see the Linux NFS FAQ). This time, run:
killall -KILL rpciod
rpciod (the kernel process that handles NFS IO), will instantly respawn, sending errors to processes waiting for NFS IO, causing them to respond. If you’re mounting exports from multiple NFS servers and only wish to time out a single connection, you can do so with:
iptables -A OUTPUT -d nfsserver -j REJECT
Within about a minute, the NFS client will decide the server is unreachable. Again, the processes start responding.
You can now unmount the NFS server. No need to reboot.
Benefit: No need to reboot when an NFS mount fails.
Works in: any Linux.
Drawbacks: You can’t disable an individual NFS export, just all the exports from A particular NFS server. Still beats rebooting though.
Bonus Trick 4: Encourage Others to Use & Contribute to Your Scripts
If you want to improve your scripting skills, it pays to be kind to your peers.
- Use self-explanatory uppercase names for your variables. In particular, this means not using ‘i’ as a variable name, so when your fellow scripter is eighty lines down your twelfth, nested, for loop, they don’t have to scroll up and work out what the hell ‘i’ means now, when it’s much easier to come to your house and kill you with an axe.
- Keep your loops and conditionals indented
- Putting your functions at the top of the script, and check input.
Bonus Trick 5: Shell Sites That Don’t Suck
There’s a lot of sites on Linux shell commands. Very few are Bash specific, so you’ll be missing out on a lot of the good stuff. They also tend to be non-task oriented – if they need to show you grep, they’ll show it using some weird thing about animals, rather than, say how to strip comments and blank lines from a file.
grep -vE ‘^$|^#’ /etc/foo.conf
…by the way. Anyway, here’s a few of our personal favorites:
Tips from an RHCE – Part of Red Hat Magazine, but useful even if you’re not into Red Hat.
SHELLdorado – Not Linux specific, and a little out of date, but very practically oriented- lots of sample scripts you can pillage and plunder.
Handy Sed One Liners – Another ancient document, but the examples covered in it show 99% of what you want to use sed for.
Enjoy this article? Next week I’ll be showing you how to make OpenOffice documents from the shell. If you’re here from digg you’ll probably also want to read The 100.
- Contribute something
- Justify your opinion
- Be courteous to others
1
schimana.net » 10 Linux Tricks die man bestimmt (vielleicht) noch nicht kennt
June 17th, 2007 19:42[…] unbekannt sind diese 10 Tricks eigentlich nicht. Alles kannte ich auch noch nicht. Für einige könnte was neues dabei […]
2
admin
June 17th, 2007 20:03Vielen danke!
3
bob
June 18th, 2007 08:57http://www.shellarchive.co.uk/Shell.html
4
James
June 18th, 2007 09:08Couple of “additions”
1. To check if a box is listening to a port it’s supposed to have running do
#> sudo lsof -i :22
Not only does this tell you if there is a program listening to this port but what the program is as well. (in case something other than the standard is listening or you don’t know what it is.
2. To extract an RPM try this
#> rpm2cpio name-of-this.rpm | cpio -di
it will extract the rpm right in place
5
Caleb
June 18th, 2007 09:14I’ve used echo whatever | program before, but this is the first time I’ve seen the
6
cornelius
June 18th, 2007 09:24Nice article, some helpful tips you have here!
Only one thing: Instead of using the characters ” and ‘, you are using characters like “ ” ‘’ which won’t work when people copy and paste, and people might confuse your ‘ character with the ` character, which is actually used in bash. I would replace those characters for correctness.
Thanks.
7
John Bokma
June 18th, 2007 09:28“read The 100 too” link is broken.
Thanks, I knew some of those, but not all (mostly because they are recently introduced). I am about to switch mostly to Linux real soon, and since I am going to use the CLI a lot, articles like these are bookmarked.
8
Ydef
I haven’t been reading digg long though so that’s prolly why I missed out. Still appreciate the tip though.
June 18th, 2007 09:30Ironically, I was familiar with all your tricks except the yawn reference to pstree you made initially to the tricks we should already know.
9
erbic
June 18th, 2007 09:47Great article! Finally, some stuff I didn’t know about Bash.
Link to The 100 is broken. You accidentally included the full path to this page in the path to The 100.
10
crackmac.com » Blog Archive » 10 Linux Shell Tricks You Don’t Already Know. Really, we swear.
June 18th, 2007 10:13[…] Defaults 9. Undo Your Network Screwups After You’ve Lost the Connection 10. Check a Port is Openread more | digg […]
11
10 Linux Shell Tricks You Don’t Already Know. Really, we swear. « The other side of the firewall
June 18th, 2007 10:15[…] 17, 2007 at 7:15 pm · Filed under Hacking VentureCake » Blog Archive » 10 Linux Shell Tricks You Don’t Already Know. Really, w…: some new incantations to add to your Bash spell […]
12
Penguin Pete
June 18th, 2007 10:17Coolers! I, too, try to dig out those odd corners that you don’t often see anything written about, but I do it mainly from the perspective of the desktop user.
Nice style, BTW, with just a hint of BOFH.
13
always something
June 18th, 2007 10:56rpm -V packagename to verify files in an rpm the easy way.
14
mrchuck
June 18th, 2007 11:08Aaaaarrrrrggghhhh!
Not another recommendation to use “soft” mounts!!!!
Please read the Linux NFS FAQ and note carefully why you should never ever ever use soft mounts. The “intr” option is safe, and is sufficient for interrupting hanging programs.
“killall -KILL rpciod” actually *does* kill rpciod processes, but they restart automatically.
15
admin
June 18th, 2007 11:20mrchuck: thanks for the info – I’ve corrected accordingly.
16
Never reboot a system for stall NFS @ ZDima.net
June 18th, 2007 11:38[…] for stall NFS Posted on June 17th, 2007 by ZDima. Categories: Uncategorized.This was copied from VentureCake. I keep it here because this is useful information and would be […]
17
Greg
June 18th, 2007 12:38For tip 6. the SSH one I get this error:
$ ssh-copy-id -i .ssh/id_rsa.pub meroc.grois.net
15
/usr/bin/ssh-copy-id: ERROR: No identities found
What does that mean?
18
Mike himself
June 18th, 2007 12:51For the gent whose SSH can’t find an identity file: you need to make an identity file first. Use:
ssh-keygen
To create one.
19
indya
June 18th, 2007 13:05Useful indeed. linking this story on http://www.bestofindya.com
20
Ryan Neufeld
June 18th, 2007 13:07Thank-you! this is a great post!
21
mikegrouchy.com – links for 2007-06-18
June 18th, 2007 13:24[…] VentureCake » Blog Archive » 10 Linux Shell Tricks You Don’t Already Know. Really, we swear. (tags: development geek linux programming reference tips tech tools unix bash shell tricks) […]
22
Greg
June 18th, 2007 13:43Mike Himself, thanks for the tip. I used the command:
ssh-keygen -t rsa
with the default file path to save, and empty passphrase, and then everything worked. I’m not sure what the passphrase part was for.
23
Joshua
June 18th, 2007 14:11Those are not shell tricks they are commands. Shell tricks are when you monkey with your stty settings or utilize your profile in a good way.
24
Bryant Wong
June 18th, 2007 14:15“This one isn’t necessary on Debian based distros, as .deb are merely .tgz archives.”
The last time I checked, they were AR archives.
bryant@nfkb:/media/secstor$ tar tf linux-image-2.6.21.5_2.6.21.5-10.00.Custom_i386.deb
tar: This does not look like a tar archive
tar: Skipping to next header
tar: Error exit delayed from previous errors
bryant@nfkb:/media/secstor$ tar tzf linux-image-2.6.21.5_2.6.21.5-10.00.Custom_i386.deb
gzip: stdin: not in gzip format
tar: Child returned status 1
tar: Error exit delayed from previous errors
bryant@nfkb:/media/secstor$
25
Smith Data Processing Services » Blog Archive » links for 2007-06-18
June 18th, 2007 15:18[…] VentureCake » Blog Archive » 10 Linux Shell Tricks You Don’t Already Know. Really, we swear. (tags: shell tricks) […]
26
dave candlestick
June 18th, 2007 15:20wow. I’ve officially realized what a nerd I am.
There is nothing here that I didnt already know, or do.
27
Frank Edwards
June 18th, 2007 16:36(Continued post since the blog didn’t protect my <’s!)
Okay, a quick run-through of some tweaks to your list (overall a pretty good list).
1. This syntax only works in bash, no other shell. Okay on Linux, but not in a general-purpose POSIX environment. The standard “>file 2>&1? is portable at least.
2. Instead of “$(cat file)” it’s much faster to use “$(< file)”. And it’s portable to other Bourne-like shells. (PS: The number of open files allowed to a process can be displayed with “ulimit -a”.)
3. Only works in bash, not other Bourne-like shells. Of course, this is noted in your “Drawbacks” of item 4.
6. The ssh-copy-id script is useful, but it doesn’t scrub the GET_ID variable so there are potential security issues.
Add another Bonus tip:
Compare the output of two programs with this command line:
“diff -cb <(prog1) <(prog2)”
Bonus tip:
When working with filenames, it’s generally a bad idea to expect spaces as delimiters, since they can occur inside a filename. That becomes problematic with find(1), for example. So instead of using the first command, below, use the second:
find /some/dir -print | xargs grep -H ’somestring’
find /some/dir -print0 | xargs -0 grep -H ’somestring’
Note the use of “-print0? and “-0?. If for some reason you have a file with one filename per line and the filenames (might) contain spaces or shell metacharacters, then use tr(1) to convert the newlines into null bytes and pipe the result into xargs(1):
tr ‘[12]’ ‘[]’ < file | xargs -0 grep -H ’somestring’
The last commands are important in my situation because I own a Linux file server used by Windows users.![:P]()
Some general tips:
)
Once again, this actually works with sort’s “-o” option, but that’s the exception instead of the rule.)
Always put double quotes around your dollar signs. (This is redundant in some cases, but only wrong in 3-4 situations. So the odds are it’ll be the Right Thing To Do.
Never use the same filename twice on the command line. (This will prevent you from trying to redirect input from and output to the same file.
Always start your scripts with “#!” and the name of the shell.
Realize that LANG=C may be needed at the top of some scripts, depending on what the script does. If you grep your RedHat-provided scripts, you’ll notice liberal use of that statement.
Always use mktemp(1) for temporary filenames.
Well, that’s all I’m going to take the time to add. If you want to know more, take one of _my_ Linux training classes!![;)]()
28
10 Linux Shell Tricks You Don’t Already Know » Chandrasekhar Vallabhaneni
June 18th, 2007 16:37[…] read more | digg story […]
29
Janet![:D]()
June 18th, 2007 16:48It’s time to play with unix shell
Janet
http://www.spaml.com
30
error is the mother of all inventions
June 18th, 2007 17:11[…] web2.0, hack, fun, web, Internet, general, Technology some more tricks wich u mite not be familiar >> No Comments so far Leave a comment RSS feed for comments on this post. TrackBack URI […]
31
bramgn
June 18th, 2007 17:17The passphrase is used to encrypt your key, so that in the unfortunate case when your machine has been compromised, your private key is useless without it.
Whenever you log on to a remote system using the key pair, you’re asked to enter the passphrase. You might wonder what the whole benefit was, but keep in mind that using the keys, no sensitive information (such as a password) is sent over the net. You can use a program like ssh-agent to store the passphrase once you have entered it. This way you are only asked once per session (when you log out, the ssh-agent application will end too).
32
I Only Wish » 10 Linux Shell Tricks You Don’t Already Know. Really, we swear.
June 18th, 2007 17:50[…] read more | digg story […]
33
Monday Morning Links Serving: The June 18th Edition | [Geeks Are Sexy] Technology News
June 18th, 2007 19:40[…] -10 Linux Shell Tricks You Don’t Already Know. Really, we swear Here’s a bunch of really useful Linux shell commands you probably haven’t heard about before. […]
34
Monday Morning Links Serving: The June 18th Edition · Kokorec
June 18th, 2007 19:49[…] -10 Linux Shell Tricks You Don’t Already Know. Really, we swear Here’s a bunch of really useful Linux shell commands you probably haven’t heard about before. […]
35
Monday Morning Links Serving: The June 18th Edition · Articles
June 18th, 2007 20:55[…] -10 Linux Shell Tricks You Don’t Already Know. Really, we swear Here’s a bunch of really useful Linux shell commands you probably haven’t heard about before. […]
36
The Budding Bowyer · links for 2007-06-18
June 18th, 2007 21:19[…] 10 Linux Shell Tricks You Don’t Already Know. Really, we swear. More quick tips on the Linux shell. Sometimes it’s just easy to forget some of these, and nice to be reminded of them. (tags: linux shell cli) […]
37
My daily readings 06/18/2007 « Strange Kite
June 18th, 2007 21:39[…] VentureCake » Blog Archive » 10 Linux Shell Tricks You Don’t Already Know. Really, we swear. […]
38
JMXZ
June 18th, 2007 21:39Thanks for a more interesting list than most of the lists…
… but wow – don’t people read man pages anymore. I’d have thought that most of the bash stuff would have been known by people who reed that man page.
I did very much appreciate some of the interesting interactions between different commands (like the iptables / NFS example) tho.
39
shewdiz
June 18th, 2007 22:25thanks a lot I loved your tips ! I will link to your blog.
40
syahid ali
June 19th, 2007 02:27number 11 – ldd commands. great for solving dependencies headache.
41
test 06/18/2007 « Strange Kite
June 19th, 2007 03:41[…] VentureCake » Blog Archive » 10 Linux Shell Tricks You Don’t Already Know. Really, we swear. […]
42
House on a Red Corner » Blog Archive » links for 2007-06-18
June 19th, 2007 08:19[…] VentureCake » Blog Archive » 10 Linux Shell Tricks You Don’t Already Know. Really, we swear. ooh ooh ooh! fancy tricks to do with the CLI! I like it, and I really have to get some dirt under my fingernails in this area, soon. the remote login with SSH- public keys that do not require a password is awesome! (tags: linux shell tricks bash) […]
43
links for 2007-06-19 | Patrick Kempf
June 19th, 2007 10:22[…] 10 Linux Shell Tricks You Don’t Already Know. Really, we swear. (tags: linux shell) […]
44
walter
June 19th, 2007 19:36the fact that bash can read programm from stdin can be used to execute scripts on a remote box and collect the output localy. (you need a pswdfree access of cause see ssh how to do it).
example:
ssh user@remote “/bin/bash -s” output
this is very usefull since there is no need to have script.sh on the remote box, simplifying maintaince.
combine that with ‘2. Parallelize Your Loops’ and you have poverfull tool.
Actualy i use it it conjuction with gnuplot to generate daily charts.
45
blog.code.ae » Blog Archive » Linux shell tricks that you don’t know
June 19th, 2007 20:47[…] looking around for kick-ass shell tricks, I stumbled upon venture cake. Some of them are obvious (copying public keys around), but some were […]
46
10 Linux Shell Tricks You Don’t Already Know. Really, we swear. « digg the wordz
June 19th, 2007 23:44[…] read more | digg story […]
47
Tom Schenk
June 20th, 2007 00:39Your tip about setting passwords won’t work on all Linux distrubutions because the –stdin option to the passwd command is not universal. In particular, it doesn’t work on some SuSE systems (I haven’t tried SuSE since version 9, so this may have changed). For batch changes to the password file, I use the chpasswd command that is part of the shadow utils package.
48
Howard
June 20th, 2007 00:58Bonus tip #2 (Use Math Shells) works great with KSH (Korn shell) as well. Tested on Solaris 8 (SunOS 5.8), ksh version M-11/16/88i, and on Solaris 10 (SunOS 5.10), with KSH being the same version.
49
Sum Yung Gai
June 20th, 2007 02:07Some of these, I did know. Others, I knew the components, but those particular combinations simply never occurred to me. One of them (the NFS trick), I actually didn’t know at all.
This is a good article for those using BASH. Thank you for writing it; I will certainly be making use of the information here.
50
TechnoPrimitive » Blog Archive » VentureCake » Blog Archive » 10 Linux Shell Tricks You Don’t Already Know. Really, we swear.
June 20th, 2007 04:11[…] VentureCake » Blog Archive » 10 Linux Shell Tricks You Don’t Already Know. Really, we swear. […]
51
derekp
June 20th, 2007 05:24As for the hanging NFS mounts — another option is to use the remount flag…
# mount -oremount,intr /my/hung/filesystem
Also works on many other Unix’s.
52
Ben “Mouring” Lindstrom
June 20th, 2007 05:492. Parallelize Your Loops
In this section do note if you are doing ssh you may hit your MaxStartup if you have a massive list. We’ve had a few people complain. Or even worse is if you expect it to hit and you are in the second phase of MaxStartup where it drops XX% of inbound connections you may not get everything you expected.
– Ben
53
ttiqq.com
June 20th, 2007 05:5610 Linux Shell Tricks You Don’t Already Know…
Yeah, I’ve read them too. Lists of shell tricks you already know – pstree (wow!) bc (bash already has built-in math), and a dozen commands you see in every Linux site, book, and training course. Here’s a list of damn useful commands you haven’t h…
54
Shell tips « 0ddn1x: tricks with *nix
June 20th, 2007 06:01[…] Shell tips Filed under: Linux — 0ddn1x @ 2007-06-19 20:01:09 +0000 http://www.venturecake.com/10-linux-shell-tricks-you-dont-already-know-for-once/ […]
55
10 dicas sobre shell que você ainda não conhece « [ Admin Online ]
June 20th, 2007 12:34[…] http://www.venturecake.com/10-linux-shell-tricks-you-dont-already-know-for-once/ […]
56
Motorcycle Guy
June 21st, 2007 22:20number 9 is a pretty smart trick in my opinion
57
Link With Reality Web Log » links for 2007-06-19
June 22nd, 2007 06:33[…] 10 Linux Shell Tricks You Don’t Already Know. Really, we swear. Yet another article on 10 linux shell tricks, though purported to be ones you don’t already know for a change. (tags: article bash howto) Links :: John :: […]
58
More Shell Tips and Commands » It’s Not the Network!
June 23rd, 2007 03:00[…] but I hope it sticks around for a while, cause they’ve already got at least one great entry: 10 Linux Shell Tricks You Don’t Already Know. Really, we swear. And for the most part, they were right (I knew about backgrounding commands in a loop, using tar […]
59
10 Linux Shell Tricks You Don’t Already Know. Really, we swear.
June 24th, 2007 02:24[…] 10 Linux Shell Tricks You Don’t Already Know. Really, we swear. – [Venture Cake] […]
60
Monday Morning Links Serving: The June 18th Edition · New York Articles
June 25th, 2007 04:59[…] -10 Linux Shell Tricks You Don’t Already Know. Really, we swear Here’s a bunch of really useful Linux shell commands you probably haven’t heard about before. […]
61
links for 2007-07-02 — From My Mind…
July 3rd, 2007 08:34[…] VentureCake » Blog Archive » 10 Linux Shell Tricks You Don’t Already Know. Really, we swear. (tags: linux shell bash tips tricks unix commands sysadmin) […]
62
rupert
July 9th, 2007 13:36I have been doing:
command 2>&1 | tee myout to capture out put…
All this time I could have been doing
command &> | tee myout.txt
63
How to write about Linux for Digg? | PatchLog
July 21st, 2007 04:16[…] , 10 minutes to run every Windows app on your Ubuntu desktop ) but also some unique tips like 10 Linux shell tricks you don’t already know. Really, we swear. These icons link to social bookmarking sites where readers can share and discover new web […]
64
Th& P1@9u& » Blog Archive » 10 dicas sobre shell que você ainda não conhece.
July 24th, 2007 03:39[…] http://www.venturecake.com/10-linux-shell-tricks-you-dont-already-know-for-once/ […]
65
links for 2007-07-28 « geek notes
July 28th, 2007 19:26[…] VentureCake » Blog Archive » 10 Linux shell tricks you don’t already know. Really, we swear. Basic (Li|U)nix shell tips (tags: shell tips unix linux) […]
66
Marcos Elias![:)]()
August 6th, 2007 17:53Thanks
67
nerdybird.org » digg newly popular 1-30days
August 10th, 2007 01:04[…] To Top 10 Unofficial Gmail Apps and Add-ons Time to check: Are you using the right blogging tool? 10 Linux shell tricks you don’t already know. Really, we swear. Google Earth Reveals Oddities and Secrets So You Want to Be a Linux Developer? A Simple 10 […]
68
Sam Byrne![;)]()
August 14th, 2007 08:36Wow! Somebody publishing shell tips as if they’ve done linux administration in BASH before…
Got some new ones on me here. The bits about adding the public key…that will save me some time not having to freakin’ edit a dozen different authorized_keys files and the one about the network catch…I always wondered why I carefully created a backup copy of the config file and then trepidatiously sent the restart command…now I know!
Seriously good stuff folks. Even for a seasoned linux codger like myself.
THANKS!
69
Nasty Robots
November 13th, 2007 09:01Cool. I am going to use the ssh-copy-id script. I had to do some searching around but found it.