What's the one Linux command you wish you knew years ago?
41–50 of 216 posts
Re: What's the one Linux command you wish you knew years ago?
#42Re: What's the one Linux command you wish you knew years ago?
#43uptime. I had a phone screening itw with Google and it was the answer to one question. I answered sar, which is much more powerful, and top, but caller wasn't tech and I probably missed a checkbox.
Re: What's the one Linux command you wish you knew years ago?
#44Earlier quoted context omitted.
Never thought to use ``. I always used xargs: find . -name *.java | xargs cat | wc -l
Your approach works better than backtick expansion, since it won't run into 'command line too long' issues; but it will still break on "weird" file names (e.g., file names with spaces in them). The correct way to do this is find . -name *.java -print0 | xargs -0 cat | wc -l
The command line can be a large as available memory (for a single processes). (Although the ratio between command line length and allocated memory is not obvious since it depends on the number of words in the command line.)
Re: What's the one Linux command you wish you knew years ago?
#45Actually the new top comment blew me away. I'm in the 20 year veteran category and was also oblivious. Quoted: disown - bash built in. You know how you always start that mega long rsync in an ssh session from your laptop and then realize you have to go offline halfway through? You forgot to start it in screen or nohup, didn't you? You can pause it (ctrl+z), background it (bg), and then disown it so it is protected fr…
Re: What's the one Linux command you wish you knew years ago?
#46 mv /path/to/some/file.{jpg,png}
Has been a huge timesaver. It's the same as mv /path/to/some/file.jpg /path/to/some/file.png
But saves you the typing/copy pasting the path for the second argument. Can also be used with cp etc.Re: What's the one Linux command you wish you knew years ago?
#47I could've used this many times to catch cases where the amount of work being performed didn't match my expectations; usually an indication of an incorrect assumption or mistake I had made. Instead I sat there waiting for something way longer than I should've, only because I had a bad feedback loop.
Re: What's the one Linux command you wish you knew years ago?
#48 $ diff -u
Internally, bash creates a pipe and passes /dev/fd/XXX to the main command.Re: What's the one Linux command you wish you knew years ago?
#49Actually the new top comment blew me away. I'm in the 20 year veteran category and was also oblivious. Quoted: disown - bash built in. You know how you always start that mega long rsync in an ssh session from your laptop and then realize you have to go offline halfway through? You forgot to start it in screen or nohup, didn't you? You can pause it (ctrl+z), background it (bg), and then disown it so it is protected fr…
http://www.commandlinefu.com/commands/browse/sort-by-votes
Most of my time savers that I've never thought of were found there.