Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
to logout a p
rudimentary,
We always rec
account
6)bc :bc utility is surely one of the underdogs when it comes to calculations on comma
nd line. It s a feature rich utility that has its own fan base but needs time to g
et comfortable with. Here, in this article, structured in form of Q&A, let s get c
omfortable with bc utility by discussing both basic and advanced features of thi
s command line calculator.
7)cat :The cat stands for (Concatenation). Concatenate (join) two or more plain file and/
or print contents of a file on standard output
8)mkdir :The mkdir (Make directory) command create a new directory with name path. However
is the directory already exists, it will return an error message cannot create fo
lder, folder already exists .
9)cd :-
Finally, the frequently used cd command stands for (change directory), it change t
he working directory to execute, copy, move write, read, etc. from terminal itse
lf.
10)cd .. :Move to the parent directory of the current directory. This command will make th
e current working directory "/home.
11)rmdir :Deletes the specified directory, provided it is already empty
12)ls :ls [option(s)] [file(s)]
If you run ls without any additional parameters, the program will list the conte
nts of the current directory in short form.Type ls to see a list of the files an
d directories located in the current directory. If you re in the directory named g
ames and you type ls, a list will appear that contains files in the games direct
ory and sub-directories in the games directory
13)cat > :cat stands for "catenate." It reads data from files, and outputs their contents.
It is the simplest way to display the contents of a file at the command line.
We will create a file called test2 file with below command.
cat >test2
14)man :Type man followed by a command to get detailed information about how to use the
command. Ex:
man ls
15)tree :tree lists the contents of directories in a tree-like format. It's a really neat
and useful program you can use at the command line to view the structure of you
r file system.tree is a recursive directory listing program that produces a dept
h indented listing of files and output is to tty. With no arguments, tree lists
the files in the current directory.
16)who :The who command prints information about all users who are currently logged in
17)who am i :Whoami prints or writes the user/login name associated with the current user ID
to the standard output.
18)clear :Type clear to clean up your command prompt window.
This is especially helpful when you are typing lots of commands and need a clean
window to help you focus.
This is also useful when you are getting ready to type a rather long command and
Field 6
Last modified date & time: Sixth field specifies the date and time of
the last modification of the file. In this example, Jun 13 15:27'
specifies
the last modification time of the file.
Field 7 File name: The last field is the name of the file. In this example, the
file name is mthesaur.txt.gz.
--------------2)chmod :chmod is used to change the permissions of files or directories.
There are two ways to represent these permissions: with symbols (alphanumeric ch
aracters), or with octal numbers (the digits 0 through 7).
Let's say you are the owner of a file named myfile, and you want to set its perm
issions so that:
1.the user can read, write, and execute it;
2.members of your group can read and execute it; and
Here the digits 7, 5, and 4 each individually represent the permissions for the
user, group, and others, in that order. Each digit is a combination of the numbe
rs 4, 2, 1, and 0:
4
2
1
0
stands
stands
stands
stands
for
for
for
for
"read",
"write",
"execute", and
"no permission."
owner-user file
owner-user:owner-group file
owner-user:owner-group directory
options owner-user:owner-group file
------------4)mv :To rename a single file on the server, type mv, then the current file name, and
then the new file name:
mv oldfile newname
You can also move the file into a different directory and change the name:
To move one or more files into an existing subdirectory, specify the files (usin
g wildcards if desired), and then the destination directory:
mv file dir
mv file1 dir1/file2 dir2
mv *.c *.h ..
-----------5)cp :Copies files and directories
cp is one of the basic command in Unix. You already know that it is used to copy
one or more files or directories from source to destination.
While this tutorial is for beginners, it is also helpful for everybody to quickl
y review various cp command options using some practical examples.
Even if you are using cp command all the times, probably one or more examples ex
plained below might be new to you.
The general form of copy command:
cp [option] source destination
------------6)wc :The wc (word count) command is a very simple utility found in all Unix variants.
Its purpose is counting the number of lines, words and characters of text files
. If multiple files are specified, wc produces a count for each file, plus total
s for all files
wc [OPTION]... [FILE]...
----------7)umask :-----------8)factor :factor - factor numbers
SYNOPSIS
factor [NUMBER]...
factor OPTION
-------------9)ln :ln - make links between files
SYNOPSIS
ln
ln
ln
ln
[OPTION]...
[OPTION]...
[OPTION]...
[OPTION]...
(1st
(2nd
(3rd
(4th
form)
form)
form)
form)
DESCRIPTION
In the 1st form, create a link to TARGET with the name LINK_NAME. In
the 2nd form, create a link to TARGET in the current directory. In the
3rd and 4th forms, create links to each TARGET in DIRECTORY. Create
hard links by default, symbolic links with --symbolic. When creating
hard links, each TARGET must exist.
-----------10) head :head - output the first part of files
SYNOPSIS
head [OPTION]... [FILE]...
DESCRIPTION
Print the first 10 lines of each FILE to standard output. With more
than one FILE, precede each with a header giving the file name. With
no FILE, or when FILE is -, read standard input.
-----------11)tail :tail - output the last part of files
SYNOPSIS
tail [OPTION]... [FILE]...
DESCRIPTION
Print the last 10 lines of each FILE to standard output. With more
than one FILE, precede each with a header giving the file name. With
no FILE, or when FILE is -, read standard input.
--------12)more :more - file perusal filter for crt viewing
SYNOPSIS
more [-dlfpcsu] [-num] [+/ pattern] [+ linenum] [file ...]
DESCRIPTION
More is a filter for paging through text one screenful at a time. This
version is especially primitive. Users should realize that less(1) provides more(1) emulation and extensive enhancements.
----------13)less :less - opposite of more
SYNOPSIS
less
less
less
less
less
-?
--help
-V
--version
[-[+]aBcCdeEfFgGiIJKLmMnNqQrRsSuUVwWX~]
[-b space] [-h lines] [-j line] [-k keyfile]
[-{oO} logfile] [-p pattern] [-P prompt] [-t tag]
[-T tagsfile] [-x tab,...] [-y lines] [-[z] lines]
[-# shift] [+[+]cmd] [--] [filename]...
(See the OPTIONS section for alternate option syntax with long option
names.)
DESCRIPTION
Less is a program similar to more (1), but which allows backward movement in the file as well as forward movement. Also, less does not have
to read the entire input file before starting, so with large input
files it starts up faster than text editors like vi (1).
-----------14)pg :-----------15)chgrp :chgrp - change group ownership
SYNOPSIS
chgrp [OPTION]... GROUP FILE...
chgrp [OPTION]... --reference=RFILE FILE...
DESCRIPTION
Change the group of each FILE to GROUP. With --reference, change the
group of each FILE to that of RFILE.
---------16)piping :----------17)sort :sort - sort lines of text files
SYNOPSIS
sort [OPTION]... [FILE]...
DESCRIPTION
Write sorted concatenation of all FILE(s) to standard output.