to become familiar with the Bash shell and basic Linux commands Allows a user to execute commands by typing them manually at a terminal, or automatically
Previous PDF | Next PDF |
[PDF] The Linux Command Line
3 oct 2009 · The Linux Command Line Second No Starch Press also offers this book in elec- Regardless of how you install Linux, you will need to have
[PDF] Commands in linux terminal pdf - Squarespace
To open the terminal, press Ctrl+Alt+T in Ubuntu or press Alt+F2, type For example, if you are in the home folder, and want to go to the downloads folder,
[PDF] Unix/Linux Command Reference
Unix/Linux Command Reference File Commands 1 ls Directory listing 2 ls -al Formatted Continue a stopped download Unix/Linux Command Reference
[PDF] BGI Online Command Line Interface User Guide - NIH HPC
Their installation procedures are outside the scope of this document 2 2 Installation To install BGI Online CLI, just unpack the package into the installation folder:
[PDF] Linux Command Line and Shell Scripting Bible
Linux® Command Line and Shell Scripting Bible Richard Blum of Linux LiveCDs that you can download from the Internet and burn onto a CD to test drive
[PDF] Download Ubuntu Tutorial - Tutorialspoint
Step 2: The search result of Terminal appears Click it to open the command prompt Step 3: Next, issue the following command sudo apt-get install gnome- system
[PDF] Introduction to the Linux Command Shell For Beginners
to become familiar with the Bash shell and basic Linux commands Allows a user to execute commands by typing them manually at a terminal, or automatically
[PDF] AWS Command Line Interface - User Guide - AWS Documentation
18 sept 2019 · AWS We recommend that you install the AWS CLI from only the official AWS Prompt – The command prompt uses the Linux prompt and is
[PDF] Kali Linux Revealed book
7 results · 3 2 2 Command Line Basics: Browsing the Directory Tree and Managing step from the download of the ISO image to getting Kali Linux running on
[PDF] download delta flight schedule
[PDF] download file command in linux
[PDF] download fortinet android
[PDF] download fortinet ems
[PDF] download fortinet firmware
[PDF] download fortinet fsso agent
[PDF] download fortinet virtual appliance
[PDF] download fortinet visio stencils
[PDF] download html5 and css3 pdf
[PDF] download latex
[PDF] download math.h header file
[PDF] download mit ocw videos
[PDF] download oxford dictionary pdf
[PDF] download oxford dictionary pdf free
An Introduction to the
Linux Command Shell
For Beginners
Presented by:
Victor Gedris
In Co-Operation With:
The Ottawa Canada Linux Users Group
andExitCertified
Copyright and Redistribution
vic@gedris.org. http://vic.dyndns.org/].For more information on Open Office, please visit http://www.openoffice.org/.Copyright © 2003 Victor Gedris.
http://www.fsf.org/copyleft/fdl.htmlDocument Version: 1.2, 2003-06-25
1.0Introduction
practical examples, and references to DOS commands are made, where appropriate.1.1What is a command shell?
?A program that interprets commands in programs called shell scripts. commands.1.2What is BASH?
?BASH = Bourne Again SHell originally written by Steve Bourne for UNIX systems. program with and use from the command line. ?Since it is Free Software, it has been adopted as the default shell on most Linux systems.1.3How is BASH different from the DOS command prompt?
?Case Sensitivity:InLinux/UNIX,commandsandfilenamesarecasesensitive,meaning that typing "EXIT" instead of the proper "exit" is a mistake. ?"\" vs. "/":InDOS,theforward-slash"/"isthecommandargumentdelimiter, about these special characters in a minute! up to 3 characters long (e.g. FILENAME.TXT). In UNIX/Linux, there is filename, and "extensions" may be interpreted differently by all programs, or not at all.1.4Special Characters
operations, or, c) must be ªescapedº if you want to use them in a normal way.CharacterDescription
Escape character. If you want to reference a special character, you must ªescapeº it with a backslash first.Example:touch /tmp/filename\*
Directory separator, used to separate a string of directory names.Example:/usr/src/linux
Current directory. Can also ªhideº files when it is the first character in a filename.Parent directory
User©s home directory
Represents 0 or more characters in a filename, or by itself, all files in a directory. Example:pic*2002 can represent the files pic2002, picJanuary2002, picFeb292002, etc.Represents a single character in a filename.
Example:hello?.txt can represent hello1.txt, helloz.txt, but not hello22.txt Can be used to represent a range of values, e.g. [0-9], [A-Z], etc. Example:hello[0-2].txt represents the names hello0.txt, hello1.txt, and hello2.txt ªPipeº. Redirect the output of one command into another command.Example:ls | more
Redirect output of a command into a new file. If the file already exists, over-write it.Example:ls > myfiles.txt
Redirect the output of a command onto the end of an existing file. Example:echo Mary 555-1234" >> phonenumbers.txtRedirect a file as input to a program.
Example:more < phonenumbers.txt
Command separator. Allows you to execute multiple commands on a single line.Example:cd /var/log ; less messages
Command separator as above, but only runs the second command if the first one finished without errors.Example:cd /var/logs && less messages
Execute a command in the background, and immediately get your shell back.Example:find / -name core > /tmp/corefiles.txt &
1.5Executing Commands
The Command PATH:
?Most common commands are located in your shell©s ªPATHº, meaning that you can just type the name of the program to execute it. Example: Typing ª lsº will execute the ª lsº command. ?Your shell©s ªPATHº variable includes the most common program locations, such as /bin, /usr/bin, /usr/X11R6/bin, and others. ?To execute commands that are not in your current PATH, you have to give the complete location of the command.Examples:/home/bob/myprogram
./program (Execute a program in the current directory) ~/bin/program (Execute program from a personal bin directory)Command Syntax
?Commands can be run by themselves, or you can pass in additional arguments to make them do different things. Typical command syntax can look something like this: command [-argument] [-argument] [--argument] [file] ?Examples:lsList files in current directory ls -lLists files in ªlongº format ls -l --colorAs above, with colourized output cat filenameShow contents of a file cat -n filenameShow contents of a file, with line numbers2.0Getting Help
available through online help programs (ªman pagesº and ªinfo pagesº), and of course online.
2.1Using a Command"s Built-In Help
These flags usually look like ª-hº or ª--helpº.Example:grep --help
2.2Online Manuals: "Man Pages"
known as ªman pagesº for short. To read a command©s man page, type ªman commandº. Examples:man lsGet help on the ªlsº command. man manA manual about how to use the manual! type the ªQº key. descriptions for the word ªpermissionº like this: man -k permission If you look at the output of this command, you will find a line that looks something like: chmod (1) - change file access permissions show you the chmod command©s manual page!2.3Info Pages
Linux distributions, ªpinfoº (a nicer info browser). For example:info dfLoads the ªdfº info page.3.0Navigating the Linux Filesystem
describes many of the most common Linux directories.3.1The Linux Directory Layout
DirectoryDescription
directory itself. /bin tar, etc.) /bootStatic files of the boot loader.
/dev they are kept under this directory. /etcHost-specific system configuration files.
/home Location of users© personal home directories (e.g. /home/susan). /libEssential shared libraries and kernel modules.
/proc Process information pseudo-filesystem. An interface to kernel data structures. /rootThe root (superuser) home directory.
/sbin Essential system binaries (fdisk, fsck, init, etc). /tmp Temporary files. All users have permission to place temporary files here. /usr documentation, and much more). /usr/bin Most user programs are kept here (cc, find, du, etc.). /usr/includeHeader files for compiling C programs.
/usr/libLibraries for most binary programs.
/usr/local with the distribution. /usr/sbinNon-vital system binaries (lpd, useradd, etc.)
/usr/share man pages, etc.). /usr/src Program source code. E.g. The Linux Kernel, source RPMs, etc. /usr/X11R6The X Window System.
/var Variable data: mail and printer spools, log files, lock files, etc.3.2Commands for Navigating the Linux Filesystems
you might already be familiar with.Linux CommandDOS CommandDescription
pwd location in the directory tree. cd cd, chdirªChangeDirectoryº.Whentypedallbyitself,it returns you to your home directory. cd directory cd directoryChangeintothespecifieddirectoryname.Example: cd /usr/src/linux
cd ~ directories relative to your home. cd .. up in /home. cd -Returntopreviousdirectory.Aneasywaytoget
back to your previous location! ls dir /wListallfilesinthecurrentdirectory,incolumn format. ls directory dir directoryList the files in the specified directory.Example: ls /var/log
ls -l as ownership, permissions, date, and size. ls -a dir /aListallfiles,includingªhiddenºfiles.Hiddenfiles .bash_history file in your home directory. ls -ld the following two commands: ls -l /usr/bin ls -ld /usr/bin ls /usr/bin/d* dir d*.*Listallfileswhosenamesbeginwiththeletterªdº in the /usr/bin directory.4.0Piping and Re-Direction
programmer or user to combine these utilities to make more useful command sequences.4.1Piping Commands Together
third program, etc. For example: ls -la /usr/bin | less output to a program called ªlessº, which displays the output for us one screen at a time.4.2Redirecting Program Output to Files
we can do something like this, using the ª>º redirection character: ls -l /home/vic/MP3/*.mp3 > mp3files.txt we can append to the end of the original file: ls -l /home/vic/extraMP3s/*.mp3 >> mp3files.txt5.0Other Linux Commands
I can©t possibly cover the details of all of these commands in this document, so don©t forget that you
available on all Linux or UNIX distributions.