Foogazi is running a 25 Dollar Amazon Gift Card Giveaway Challenge! Click here to participate!
Powered by MaxBlogPress  

17 Comments

philluminati Said,
March 18th, 2008 @1:35 pm  
You can use the last argument from the last command by refering to it as $_

so you only need to type a long path like this once:

cp assignment.htm /home/phill/reports/2008/

and do:

cd $_

to go straight to the 2008 folder as well. You can use this however you like. Always the last argument of the command above.

mygif
Grey Said,
March 21st, 2008 @2:23 pm  
I find it horribly saddening that people are falling away from the command line. I personally use most of these commands multiple times a day. To think that these are the ones that people don’t use…
mygif
mrozekma Said,
April 23rd, 2008 @3:01 pm  
philluminati mentioned using $_ for the last argument of the last command; you can also hit Alt+. to quickly paste it at the cursor.
mygif
bit-head Said,
April 24th, 2008 @11:52 am  
I almost find this article’s title offensive. I too use most of these commands daily because my job requires I be efficient. Put it this way, its much easier to click on the wrong icon then it is to type the wrong program name. How often do you type “firefox” when you really wanted to type “xterm”?
mygif
Steve K Said,
April 24th, 2008 @12:57 pm  
Should have mentioned using touch to make a new empty file - just the thing for new kids playing around. And speaking of things most users don’t use, how about linx and wget? Massive time savers, plus you can surf the web and download stuff without it being obvious to anyone who may wander past. ;o)
mygif
getoffmylawn Said,
April 24th, 2008 @1:36 pm  
In all fairness, I don’t see how you can categorize any of these as really being “Linux” commands. Hell, most aren’t really OS commands, per se.

The only ones that are really OS commands would be the pgrep, mkdir and touch. Of those, the only one that’s even remotely specifically a Linux command is `pgrep`. Even that’s kind of a stretch, as several other *N*X’s have a pgrep implementation. Every *N*X implements mkdir and touch in the ways described above.

The rest are “shell built-ins” - specifically, Bash. If you’re one of the (admittedly rare) users that changes their shell, your “Linux commands” likely won’t work (e.g., if someone installs and uses pdksh). While Bash was initially unique to Linux, the functionalities that you’re describing are functionalities that Bash borrowed from other shells (e.g., Tenex C-Shell). So, again: not really “Linux commands”.

mygif
Oshu Said,
April 24th, 2008 @1:46 pm  
You are not quite right about ctrl-u. It doesn’t delete the entire line, it deletes everything to the left of the cursor. So it will only delete the entire line when the cursor is at the end of the line. Also, hitting ctrl-k will delete everything to the right of the cursor.
mygif
Stu Said,
April 24th, 2008 @2:02 pm  
One cool one I recently learned is fc, fc will open the last command from your shell history in the default editor. You can also specify a text editor. You can add a history line number or the first few letters of the most recent command. For example “fc -e kate wget” will open kate with the last shell command starting with wget. You can edit the command, and when you save and close kate, the command will execute.
mygif
ts Said,
April 24th, 2008 @6:37 pm  
Oshu is right about ctrl+u; it only deletes everything to the left of the cursor. This is especially useful when you know you fat fingered your password and you want to quickly start over. Also works on cisco routers.
mygif
des Said,
April 26th, 2008 @2:41 pm  
The !! command is very useful when you forget to start a commando with “sudo” in Ubuntu:

apt-get update
sudo !!

And yes, it looks like you are shouting: “I MEANT TO USE SUDO!” ;)

mygif
Joe Said,
April 26th, 2008 @4:02 pm  
Another useful command is ‘&’ (ampersand)
Ending a command with ‘&’ runs the command with a new PID, releasing the command line back to you. Useful for running a background process.
mygif
Slightcrazed Said,
April 28th, 2008 @12:32 pm  
The one command *nix DOESN’T have but NEEDS:

#!/bin/ksh
mkdir “$1″
cd “$1″

Save the above as an executable script (I call mine mkcd) and use it:

$ mkcd dir

Stupid, you say? I thought so, and now I get ticked whenever I’m on someone else’s system that DOESN’T have it. How many times to you end up having to make a directory and then immediately cd into it? Quite a few, if you’re like me. I know the above doesn’t have any error checking, but it’s for my own use. I have a similar script that acts like mv, only it makes a directory, moves the file into it, and then cds you into that directory.

If there are other ways of doing these things, I’m open to ideas…….

mygif
ed Said,
April 29th, 2008 @1:01 pm  
I think cd with no arguments takes you to your home directory on most systems (equivalent to cd ~), not last directory you where in as stated here.
mygif
Marc Said,
April 30th, 2008 @5:56 am  
I think it’s “cd -” not “cd” that is written in the 10 commands…
mygif
deez Said,
May 10th, 2008 @8:28 am  
I never knew about +z+z in vi before. I suppose its just as many kepresses as exiting insert mode and typing : w
mygif
Pingback & Trackback

Random Post

Leave Your Comments Below

Please Note: All comments will be hand modified by our authors so any unsuitable comments will be removed and you comments will be appreared after approved