July 11th, 2012, 07:55 AM
20 things a newbie should commit to memory
I am still very green when it comes to Linux/Unix. I read a book or a tutorial, and get overwhelmed by the amount of detail.
To ease this learning curve, can anyone suggest some must know facts/commands/concepts? Below are several I identified. I am not looking for everything, but as the title suggestions, just the top 20.
- bin and sbin files are available by default (reference $PATH)
- Directing inputs and outputs
- Most commands have both a long version and short version option (i.e. ls --all and ls -a). Is the one versus two hyphens universal?
- How devices are like directories in /dev
- Logging on as root using su
July 11th, 2012, 12:01 PM
6. Learn how to use the man pages
Originally Posted by NotionCommotion
7. Exercise with text manipulation tools like awk, sed, cut, uniq, sort, etc. (i guess this might fall under piping as well)
Comments on this post
July 11th, 2012, 01:24 PM
Remember linux filenames are case-sensitive.
Learn how to interpret your system log files.
Learn how to install/update software on your particular distro
Setup ssh so you can access your linux computer from anywhere. Then get a few windows ssh tools like putty and winscp.
Locate good support forums on the web for your distro.
Bartender to Rene Descartes "have another beer?" Descartes: "I think not" and he vanished.
July 11th, 2012, 02:51 PM
Remember that linux filenames can have spaces in them. Be careful you don't create a file like this! You will make your life much more difficult if you get a filename with a space in it.
Top Twenty Linux Commands to REMEMBER
1 echo $PATH ===>Show list of locations, Left to Right, to be searched for executable
2 which ls ===>Use to find the location of a command to be executed
3 ls -ltr * ===>Know what each of the first ten characters means
4 cd ../ ===>Set current directory to next higher directory
5 cd ralph ===>Set current directory to ralph (must be a subdirectory of current directory)
6 pwd ===>Show current directory name
7 cp tony tony.bak ===>Copy file tony to a new file & call the new file tony.bak
8 date "+%a %b %e, %Y %l:%M %p" ===>Show current date and time
9 cd - ===>Go back to previous location of current directory
10. file jack ===>Show what kind of file jack is
11 chmod a+r jack ===>Make file jack readable by everybody
12. less jack ===>List contents of file jack, a screenful at a time
13. chmod a-w jack ===>Prevent anybody from writing or erasing file jack
14. nl tee.txt ===>Enumerate lines in file tee.txt
15. df ===>Show blocks (of free disk space) available on filesystem
16. head tee.txt ===>Show first ten lines of file tee.txt
17. tail tee.txt ===>Show last ten lines of file tee.txt
18. ls -ltr *.txt ===>Show all filenames ending in .txt, in date order, oldest at the top, newest at the bottom
19. wc -l sedfaq.txt===>Show total count of lines in file sedfaq.txt
20. wc -c sedfaq.txt===>Show total count of characters in file sedfaq.txt
July 11th, 2012, 08:35 PM
I was about to comment that I didn't have 20, but EEmaestro foiled those plans. I have been going through each, and will continue to do so.
One comment I have is whether there are any common items that span multiple commands? For instance, I understand that -i is sometimes about interactive and -v is sometimes about verbose. Is this a de facto standard which is applied for many commands? Are there more of these de facto standards?
July 12th, 2012, 06:34 AM
Sadly, pretty much the only standard is that there is no standard, and this becomes more so between Unix and Linux. The -v option often means verbose (with some programs/scripts allowing more 'v's to increase verbosity (such as -vvv)) whilst some other will return version details.
Not 20, and not comprehensive by any means, but:
Get to understand the difference between relative and absolute paths.
Be aware of, and understand, the use of the $PATH environment variable - especially with regard to things run under cron.
Understand how file expansion/globbing works.
Even in today's world of faster and better and more, try and be efficient: if you only need filenames listed use ls -1 instead of ls -l (one instead of ell). If you need more information, but not owner or group, look at the ls -log options.
Know about, and understand, the use of stdin, stdout and stderr (files 0, 1 and 2).
Know and understand about redirection and piping.
Do not assume everyone uses the same shell as you do.
The man pages are your friend.
Determining information (memory, CPUs, disks, etc.) will be both OS and manufacturer specific.
Get to learn an editor, of your choice, really well, but be aware of and basic usage of vi which is a common denominator.
The moon on the one hand, the dawn on the other:
The moon is my sister, the dawn is my brother.
The moon on my left and the dawn on my right.
My brother, good morning: my sister, good night.
-- Hilaire Belloc