PDA

View Full Version : [ubuntu] Learning the command line



DMGrier
January 15th, 2013, 02:50 AM
So I am slowly learning the command line, I did start on Ubuntu 8.04 but I only forced myself to learn simple things like installing and removing applications.

I picked up a copy of Ubuntu Unleashed and I am going going through the command line part and I know these thing seem simple but I cannot figure out how to do a pipeline? I have a English USA keyboard layout and was hoping I could get some help. Thanks guys.

eenofonn
January 15th, 2013, 02:55 AM
it's usually "shift + \" right above the enter key which gives you a | which is displayed a bit different on the keyboard.

a good example of pipe "|" would be



ifconfig | less


or something like



cat /proc/meminfo | less


These are just simple examples but give you a good idea of what a pipeline does, piping the output of one command/program into another

DMGrier
January 15th, 2013, 02:58 AM
Just gave it a shot, and it worked. Thanks man for the quick reply.

eenofonn
January 15th, 2013, 03:03 AM
Just gave it a shot, and it worked. Thanks man for the quick reply.

Glad to hear it another fun little tool is ">"

which sends the output to a file:



cat /proc/cpuinfo > ~/cpuinfo.txt


that takes the output of "cat /proc/cpuinfo" and puts it into a new file in your home directory called cpuinfo.txt

DMGrier
January 15th, 2013, 03:33 AM
awesome, I am working on it. I am trying to learn what I can since I am starting college classes this spring for a degree for network security. Just toured the campus and got very excited when I saw the security core classes is taught on Ubuntu machines.

eenofonn
January 15th, 2013, 03:53 AM
awesome, I am working on it. I am trying to learn what I can since I am starting college classes this spring for a degree for network security. Just toured the campus and got very excited when I saw the security core classes is taught on Ubuntu machines.

Nice

tgalati4
January 15th, 2013, 04:31 AM
Add to an existing file:


ls > mydirectorylisting.txt; ls -la >> mydirectorylisting.txt
cat mydirectorylisting.txt

Common pipe commands that I use:


dmesg | more
dmesg | tail -50
ps -ef | more
dmesg | grep BogoMIPS
ps -ef | grep syslog

NikiNfOuR
January 15th, 2013, 09:49 AM
I am new at command line myself!! if you haven't got this get this command line learning book that covers everything about terminal :)

http://linuxcommand.org/tlcl.php