mercredi 25 juillet 2018

Linux Commands Memo

To withdraw on the Root Server for example, know what you need woosh orders ..

Annexed to the orders that you are downloading ..

All you have to sit down and Tqriham time to arrange the orders are needed in a special file to you ..

Due to them when needed ..

Here View the orders which are in use by

pwd: display the full path to the current folder
ls: Show all files in the current folder
ls-al: Show all files and information
ls-alR: Show all files and subfolders in the information
ls-alR> filename.txt: such as ls-alR, but leave the result in the file
ls *. html: All files ending spill. html
cd [directory name]: change the current folder to another to be determined to write his name
cd .. : The current pace of change in volume one of the highest
clear: clean up the screen
vdir: give more information than it ls
exit: exit for the registration of Hel

Transfer, copying and scanning of files:
mv [old filename] [new filename]: the transfer or rename a file
cp [filename] [new filename]: to copy the file
rm [filename]: file of the survey
rm *: delete all the files in the current folder
rm *. html: a survey of all the files that the extension of expiring. html
rm-rf [directoryname]: survey of the entire volume

Create, move, copy and scan folders:
mkdir [directory name]: Create a new folder
ls-d * /: display all the folders within the current folder
cp-r [directory] [new directory]: copies of all files and folder within the new stripes

Search for files and folders:
find. -name [filename]-print: to search for the file
grep [********************************] [filename]: the search for text within the file

Permits files and folders:
There are three levels of permits files are: reading Read, Write and write implementation execute, there are also three sets to give such permits: Owner or Owner, Group and User Group for all everyone.
Chmod is used followed by Ptlatp numbers of permits, the first number is the owner of the Owner, and the second number of the Group and the third one is for all Everyone .. This interpretation of the numbers and levels of these permits:

0 = --- No permission
1 = - X Execute only
2 =-W-Write only
3 =-WX Write and execute
4 = R - Read only
5 = R-X Read and execute
6 = RW-Read and write
7 = RWX Read, write and execute


Always prefer to give a statement (0) to a Group in order to prevent the other users to browse the files from the server using the Telnet or FTP until

These are some of the most common permits:

chmod 604 [filename]: less of a statement to the Mphat Html
chmod 705 [directory name]: less a statement of volumes
chmod 755 [filename]: the least of the programs and permit Alascrepettat
chmod 606 [filename]: statement of the least used by Mphat Alascrepettat
chmod 703 [directory name]: read-only permission for the Public FTP

How to decompress the archive file using the Telnet:
First, to verify that you are inside the folder that contains your compressed file is written ls
If the file is not present your writing:
cd / big / dom / xdomain / www / directory /
Track your path to replace the file which contains your

Now the process is how to decompress the archive?
If the file extension ends. Zip File.zip for example, your writing is:
unzip file.zip

If the file extension ends with. Tar example file.tar your writing:
tar-xvf file.tar

If the file extension ends with. Gz file.gz like your writing:
gzip-d file.gz

If the file extension ends with. Tar.gz example file.tar.gz your writing:
gzip-d file.tar.gz
Therefore:
tar-xvf file.tar

How to backup the database:
mysqldump-u db_usr_name-pPASSWORD db_name> file name.SQL

How to retrieve database saved by:
mysql-u db_usr_name-pPASSWORD db_name <file name.SQL

How the pressure of the database:
tar-czvf file name.tar.gz file name.SQL

How to decompress the archive on the database:
tar-zxvf file name.tar.gz

How to do backup of all databases for a particular user:
mysqldump-uroot - all-databases | gzip> mysql_username.sql

Some other commands:
tail: like cat, but just read the end of file
tail / var / log / messages to see another 20 lines of / var / log / messages
tail-f / var / log / messages: continuing to watch for file changes during the
tail -200 / var / log / messages: print the last line of the file 200 on the screen

more: like cat
more / etc / userdomains: to browse through the file userdomains file.

pico: to use text editor
pico / home / burst / public_html / index.html: Liberation Index page for the user.

vi: another editor of the texts of many of the features, but most of the pico when used for the first time
vi / home / burst / public_html / index.html: also for the Liberation of the Index page for the user.

touch: the establishment of an empty file
touch / home/burst/public_html/404.html: to create a empty file called 404.html in the folder / home / burst / public_html /

ln: the establishment of links between files and folders
ln-s / usr / local / apache / conf / httpd.conf / etc / httpd.conf: Now you can edit / etc / httpd.conf rather than the original file. The changes will appear in the original file, as the survey link that you can change the file without the original.

rm: to delete the file
rm filename.txt: to remove a question of emphasis Confirmation deleted
rm-f filename.txt: delete the file, without question, to confirm the deletion.
rm-rf tmp /: the conversion of tmp folder and includes all the files and subfolders inside.

last: to display the log of the time
last -20: View the last 20 login process
last -20-a: presentation of the last 20 with the registration process to enter the field at the end of Hostmane

w: View current users on the server and logged on and where they are now at this moment.

netstat: View all related now.
netstat-an: offer all the related IP for the server as well as for each contact and the Port or outlet of communication.

top: to display the live system processes in the form of a nice memory, as well as information and Uptime and other useful information, which is very excellent in the management system and to ensure that everything is working well.
Screening by the use of memory to write your top and then Shift M
Screening by the use of your CPU top and then write Shift P

ps: It is short for process status which is similar to the top. It introduced the processes currently operating with the PID or Process ID, which is the definition of the Process or program, you can stop the program from this figure (as well check your orders to Kill
ps U username: display user specific programs
ps aux: Show All Processes or programs that
ps aux - forest: All the programs that work like the previous hierarchy, but very good and useful

du: to display the consumption or use of CD-Disk usage.
du-sh: to display a summary of space used by the current folder, including subfolders.
du-sh *: same thing but this is used for each file or folder basis, which is useful for finding files that reserved a large area

wc: the number of words
wc-l filename.txt: to find the file specified number of lines

cp: copies of the file
cp filename filename.backup: Copy the file to filename.backup
cp-a / home / burst / new_design / * / home / burst / public_html /: copies all files with the retention of permits to another folder

How to know the size of a file or folder:

du-h / home / username / public_html / test


kill: to stop a specific program
kill -9 PID EG: kill -9 431
kill PID EG: kill 10550
Use top or ps ux to determine the PIDs or Process I

Aucun commentaire:

Enregistrer un commentaire