Bash is the default shell, or command interpreter, for the
GNU/Linux. In shell, you have a current working
directory and many commands use that as a hidden
parameter. When you have to type a file or a directory you can
use auto-completion, by typing the first letters of the file or
directory and then pressing TAB. If you typed a
command that needs a parameter file or directory you can press
TAB twice to list all the files or directories in
the current directory.
You can use up-arrow and down-arrow to
navigate through the history of all the commands that you
previously typed.
In the following description C-<chr> means
hold the CONTROL key while typing the character
<chr>. Thus, C-f would be: hold
the CONTROL key and type f.
You can use C-r to search backwards through the list
to previously typed commands. Typing C-r again will
go to the previous matching command, C-s will go to
the next matching command. C-g will cancel your
search, ENTER will execute the command.
There are the following special directory names:
~ (tilde).. (two dots). (dot)Commands:
pwdcd
<dir>mkdir <dir>rmdir <dir>Files and directories that start with a . (dot)
are usually system files and are hidden from the list command.
ls [-a] <dir>
Without any parameter the command lists the current working
directory. If you add the -a switch, all the files,
including the hidden ones will be listed.cp <src> <dest> copy source
file to destination file, cp <file1> <file2>
... <dir> copy source files to directory, cp
-r <src_dir> <dest_dir> copy recursively
source directory to destination directory.rm
<file>. Warning: there is no
undo!mv <src>
<dest>
There are three kinds of entities that can access files and
directories: the user who created the file, users
that are part of the same group as the user who
created the file, and other users.
There are three kinds of access that can be allowed for every of the
three entities that can access a file: r entity can
read the file or directory, w entity can write the
file or directory, x entity can execute the file or
change into directory.
You can use ls -l to list files and access
permissions. The command used to change the access permissions to
a file is called chmod, and you can use
+ to allow access, and - to disallow
access. Examples:
chmod go+x ~group and other to change into home directorychmod go+rx public_htmlgroup and other to change
into and read directory public_html./PROGRAM./PROGRAM < TEST./PROGRAM > OUTPUT