Sunteți pe pagina 1din 9

Linux commands

Alias:
A way to run a command or a series of Unix commands using a shorter
name than those that are usually associated with such commands.
Listing and Creating Aliases
The general syntax for the alias command varies somewhat according to the shell. In
the case of the bash shell it is
alias [-p] [name="value"]

alias p="pwd"
p

apt-get
Apt-get is a tool to automatically update a Debian machine and to get
and install Debian packages/programs.
Apt-get
cat
A Unix/Linux command that can read, modify or concatenate text files.
Cat commands are most commonly used for displaying the contents of
a file.

Cd
The cd command changes the current directory in Linux and can
toggle between directories conveniently

Chmod
Chmod changes the access mode (permissions) of one or more files.
Only the owner of a file or a privileged user may change the access
mode.
What are the permissions?
there are three general classes of users:

•The user who owns the file ("User")


•Users belonging to the file's defined ownership group ("Group")
•Everyone else ("Other")

In turn, for each of these classes of user, there are three types of file access:

Permissio chmod
Action
n option
read (view) r or 4

write (edit) w or 2

execute (execute) x or 1

There are three types of user restriction


User Ls output
owner -rwx------

group ----rwx---

other -------rwx

Folder/Directory Permissions
Directories have directory permissions. The directory permissions restrict different actions than
with files or device nodes.

chmod
Permission Action
option
(view contents, i.e. ls
read r or 4
command)

(create or remove files from


write w or 2
dir)

execute (cd into directory) x or 1


For more help refer
https://help.ubuntu.com/community/FilePermissions

cmp
The cmp utility compares two files of any type and writes the results
to the standard output. By default, cmp is silent if the files are the
same; if they differ, the byte and line number at which the first
difference occurred is reported.

Cp
The cp command copies files and directories; copies can be made
simultaneous to another directory if the copy is under a different
name.

Date
Date sets a system's date and time. This is also a useful way to
output/print current information when working in a script file.
Df
Df displays the amount of disk space available on the file system
containing each file name argument. With no file name, available
space on all currently mounted file systems is shown.

Echo

Grep
Grep searches files for a given character string or pattern and can
replace the string with another.
Ls
The ls command lists files and directories within the current working
directory, allowing admins to see when configuration files were last
edited.
Move
mv command is used to move files and directories.

Rm
Removes the specified files from the file system

mkdir
Creates a new directory

rmdir
Deletes the specified directory

Nslookup
Nslookup allows a user to enter a host name and find the
corresponding IP address. A reverse of that process to find the host
name is also possible.

Ping
Ping allows a user to verify that a particular IP address exists and can
accept requests.
Sudo
Sudo allows a system admin to give certain users the ability to run
some (or all) commands at the root level and logs all commands and
arguments.

Less
“less” command is used to view files instead of opening the file.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.

Clear
This command cleans up the visible area of the console.

Du
This command when executed without any parameters shows the total
disk space occupied by files and subdirectories in the current directory.
Df
This command when used without any option displays informations
about the total diskspace , the disk space currently in use and the free
space on all the mounted drives.

Touch
The touch command is the easiest way to create new and empty file.

Who
This command prints the username associated with the current
effective use id.

S-ar putea să vă placă și