Linux Tutorial
From what I have heard, it sounds like the main problem in the wider adoption of Linux is the general incomprehensibility of its use (seeing as nobody reads what I write, my incomprehensibility is not an issue). Me being the sort of person that I am, I will attempt to destroy that claim by posting a short (maybe) and possibly irrelevant tutorial on a site that no one (not even Google) knows about. I have divided the tutorial into 2 sections. First, I have a section on general linux commands. Then, I have a section on how to use my favorite text editor - vi. I hope you learn something from reading this tutorial (or at least read it, if not learn anything).
Linux
- mkdir
- Creates a directory
- ls
- Lists the files in a directory. It has several options and arguments that you should be familiar with:
- -l
- list additional details about the file, such as who owns it and when it was created
- -h
- display sizes in human-readable form (2M vs. 2019536)
- -F
- classifies the file by appending a / to the end of directories and * to symbolic links
- directory
- list the files in directory
- cd
- changes your current directory
- pwd
- displays the name of the directory you are currently in
- rm
- deletes a file
- mv source dest
- moves source to dest
- cp source dest
- copies source to dest
- ln source dest
- Creates a link from source to dest. Unless used with the -s option, the files must be on the same file system
- chmod mode
- Sets permissions on a file to mode
- chown user[:group]
- Change the user, and possibly group, who owns the file to user and, if given, group
- du
- Displays how much space each directory lower in the file system takes up. Additional arguments include:
- directory
- counts space below directory
- -h
- display sizes in human-readable form (ie, 2M vs. 2019536)
- mount
- makes a device accessible in the file system (ie, mount /mnt/floppy/ might make the floppy disk visible at /mnt/floppy)
- umount
- makes a filesystem unaccessible, allowing you to remove a CD or floppy safely
- man
- displays help information on a command
- who
- lists the users currently logged on and how long they have been idle
- su
- allows you to gain superuser privelages if you know the password
- echo
- Displays the command-line argument (useful for showing environment variables)
- cat
- Displays the contents of a simple text file (sort of like Notepad on Windows™, it would have a .txt extension there)
- more
- Like cat, it displays the contents of a text file, except that it starts at the top of the file, and you can scroll down. Press q to exit
- less
- less is more - the only difference between less and more is that in less you can scroll back up the file
- vi
- My favorite text editor. It has syntax highlighting for tons of programming languages, and once you learn it, its very powerful - it is a shame I don't know nearly half of it
- pine
- email client with many options and support for address books, spam filtering, IMAP/POP access, and many more features (although I'm having issues getting IMAP to work, and I haven't tried spam filtering or POP access, so I may just be lying)
- links
- text based web browser
- date
- Displays the data:
- --utc
- Display UTC / GMT
- --set
- Set the time
- emerge
- Install new programs (Gentoo-only)
- figlet
- Display cool large ASCII characters made up of smaller ones of some sort (see the patrol 6 page for an example)
- fortune
- Pending
- which
- So you've got this command that you like to run. Now you want to know where the binary is located on your disk. which will find it.
- whereis
- Like which, except that it will also find man pages and sources for the program
- export NAME="value"
- Sets environment variable name equal to value. Some of the values that I use are
- PS1
- Prompt to use at the command line. I use
\[\033[01;32m\]\u@\h \[\033[01;34m\]\W $ \[\033[00m\], which will display "user@host working-directory $"