So you’ve installed a flavor of Linux such as Ubuntu or you have shell access to a Linux system and you want to start doing some damage. The admins at LXPages.com compiled 10 commands that every Newbie Linux user should definitely know to start being effective.
1) lsThis basic command is your eyeball into the filesystem. Use it to list the contents of a directory.
A) To view details such as the file permissions, user and group owner, last time file was modified pass the l option as suchls -l
B) You can search for filenames by using wildcards. To list files that start with the letter f, usels -l f*
2) findWhere did you save that file? Use the find command to find your files. The find command will search where you want it to search and find directories or files that match conditions such as name, date last accessed, file size and more. It has got many abilities, and they’re all listed in the man page.To search for files starting with the letter f recursively starting from the / root directory use the followingfind / -name f*
3) manWhat did we mean by the man page? man stands for manual, so “man page” really means it’s manual page. Most linux commands have manual pages that describe how the command is utilized. So you can usually type man to view it’s manual page. Great when you’re stuck and don’t know what the command is for or how it’s used. You use it by passing a command line as an option like thisman vi
4) viThe editor of choice for serious linux users [sorry Emacs fans ;-)]. Use the “man vi” command to read details on this prince of editors. Maybe this is why I love editing and coding in linux, I never have to lift my hands to do anything. Here’s a quick and dirty list of vi commands for you to start using.
A) If you notice on your keyboard the letters (H,J,K,L) are adjacent to each other, which makes them ideal keys to use for navigating this editor.a) l (move right)b) h (move left)c) j (move down)d) k (momve up)
B) YY - type in Y twice to copy a line
C) DD - type in D twice to cut a line.
D) P - type in P to paste a line.
E) :q! - quit without saving
F) :wq! - save and quit
G) :w! - save5)
catHow do you view the contents of a file? You can let the “cat” of the bag with the cat command! HA! Here’s how you can use the commandcat filename.txt6) moreWhat if there the file you cat fills more than 1 screen? You can pipe the cat command into more which will allow you to view the contents one screenfull at a time.cat filename.txt more7) grepAnd what if you need to search for certain phrases or words in a file? And for this we can use the grep command. Say we want to search for all the occurances of the word “passwd” in a filename, we can use the following commandgrep “passwd” filename.txtIf there are matches, the lines containing “passwd” will be printed.chmodYou have a script that you need to run, and oh no it won’t run? By utilizing the “ls -la” command you learned you can see if the script has execute permissions. If it doesn’t you may give it execute permission by runningchmod +x scriptfileAnd of course, you can run the scriptfile if it is a script by running it with a ./ preceding the filename on the shell command line like so./scriptfile9) psWhat are you running in the background? How can you tell? By using the “ps” command of course you can view What processes are running under your account.10) cp, mv, rmHow do you copy, move or remove a file? There’s actually three different commands for each of these functions.
A) copycp oldfilename.txt newfilename.txt
B) movemv oldfilename.txt newfilename.txt
C) deleterm oldfilename.txt
0 komentar:
Post a Comment