- copy files from one linux server to another through shell
$ scp user@from_computer:dir/filename user@to_computer:dir/filename
- open shell to another linux machine from one through shell
$ ssh user@to_computer
- Prints the owner of every file or directory in the current directory. The AWK syntax is simply “print the 3rd field in every line of data”
ls -l | awk '{print $3}' - To get the owner of only one file (filename):
ls -l | grep filename | awk '{print $3}' - To compress a folder:
zip -r target.zip folder/
- User creation
useradd username
- Change user password
passwd username
- Add user to a group
usermod -g grpname username
- Import SQL script to an empty mysql database
mysql -u root -p database_name < script_file.sql
- Unfreeze vi editor in terminal window when frozen because of ctrl+S action
press ctrl+q
- Reboot linux server remotely
sudo reboot
- Shut down linux server remotely
sudo shutdown -h now
- Kill a process
top type k to kill a process. You will be prompted for the PID of the task, and the signal to send to it. For a normal kill, send signal 15. For a sure, but rather abrupt, kill, send signal 9. The default signal, as with kill(1), is 15, SIGTERM. This command is not available in secure mode.
- To close port – 80 in following example
fuser -k 80/tcp
- To display linux distribution
1
Tuesday, July 19, 2011
Few Linux Commands Copied :)
Labels:
Unix Commands
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment