Linux commands

 0    26 词汇卡    starakoza
下载mp3 打印 检查自己
 
问题 答案
man
开始学习
command for help
> man grep
ls
开始学习
List directory contents
-l long listing (ls -l),-al (ls -al) Listing With Hidden Files
grep
开始学习
Find text in a file
grep PATTERN [FILE], grep failed auth. log
cd
开始学习
Change current directory
Forward slashes instead of backward, cd /var/log
shutdown
sudo shutdown -r 2
开始学习
Safely turn off the computer in software
sudo shutdown 2 (turn off in 2min), -r restart, -c cancel or ctrl+c
pwd
开始学习
Displays the current working directory path
Useful when changing directories often
passwd
开始学习
Change a user account password
sudo passwd [username]
mv
mv SOURCE DEST
开始学习
Move a file
mv first. txt second. txt
cp
cp first. txt second. txt
开始学习
Copy a file
cp SOURCE DEST
rm
开始学习
Remove files or directories
Does not remove directories by default, -r (removes directory)
mkdir
mkdir DIRECTORY
开始学习
Make a directory
mkdir notes
chmod
r=read, w=write, x=execute
开始学习
Change mode of a file system object
chmod mode FILE, chmod 744 script. sh
chown
开始学习
Change file owner and group
sudo chown [OWNER: GROUP] file, sudo chown professor script. sh
iwconfig
开始学习
View or change wireless network configuration
ifconfig
开始学习
View or configure a network interface and IP
Slowly being replaced by ip (ip address)
ps
开始学习
View the current processes
ps -e | more (View all processes)
su / sudo
开始学习
Some command require elevated rights
There are some things normal users can’t do
su
开始学习
Become super user
You continue to be that user until you exit
sudo
开始学习
Execute a command as the super user
Only that command executes as the super user
apt-get
开始学习
Advanced Packaging Tool (Install, update, remove)
sudo apt-get install wireshark
vi
开始学习
Visual mode editor
Full screen editing with copy, paste, and more
dd
开始学习
Backup and restore an entire partition
dd if=<source file name> of=<target file name> [Options]
Creating a disk image
开始学习
dd if=/dev/sda of=/tmp/sda-image. img
Restoring from an image
开始学习
dd if=/tmp/sda-image. img of=/dev/sda
killall / kill <pid>
开始学习
Closing programs
sudo killall firefox
xkill
开始学习
Graphical kill
kill an app with one click

您必须登录才能发表评论。