Linux命令

#Linux Cheatsheet
#Files and navigating
#Networking
#Processes
#System Info
#Compressing
#Permissions
#Others
#Files and Navigating
#Directory listening
ls
#Formatted listening
ls -l
#Formatted listening including hidden files
ls -la
#Change directory
cd
#Change to parent directory
cd..
#Show the path where actually you are
pwd
#Create a directory
mkdir
#Remove directory
rm -r
#Force remove
rm -f
#Copy file
cp
#Rename or moove file
mv
#Create file
touch file
#Output contents of file
cat [file]
#Write standart input into file
cat > [file]
#Append standart input into file
cat >> [file]
#Output contents of file it grows
tail -f [file]

#Networking
#Ping host
ping [host]

#Show the actually routing table
route -n

#Check your iptable's rules
iptables -L

#List all ports
netstat -a

#Got whois for domain
whois [domain]

#Get DNS for domain
dig [domain]

#Reserve lookup host
dig -x [host]

#Download file
wget [file]

#Recurively download files from url
wget -r [url]

#Outputs the webpage from url
curl [url]

#Connect to host as user
ssh user@host

#Connect using port
ssh -p [port] user@host

#Connect and use bind port
ssh -D user@host

#Processes
Display currently active processes
ps

#Detailed outputs
ps -aux

#Kill process with process id (pid)
kill [pid]

#Kill all processes named proc
killall proc

#System Info
Show current date/time
date

#Show uptime
uptime

#Who you're logged in as
whoami

#Display who is online
w

#Display cpu info
cat /proc/cpuinfo

#Memory info
cat /proc/meminfo

#Show memory and swap usage
free

#Show directory space usage
du

#Displays readable size in GB
du -sh

#Show disk usage
df

#Show karnel config
uname -a

#Compressing
tar files into file.tar
tar -cf [file.tar] [files]

#Untar into current directory
tar -xf [file.tar]

#Show contents of archive
#Show contents of archive
#Options :
c - create archive
t - table of contents
x - extract
z - use zip/gzip
f - specify filename
k - do not overwrite
v - verbose

#Permissions
#Change permissions of file
chmod [rights] [file]
4 - read(r)
2 - write(w)
1 - execute(x)

#order : owner / group / world
chmod 777 - rwx for everyone
chmod 755 - rw for owner, rx for group and world

#Others
#Search in files for pattern
grep '[pattern]' [files]

#Search for pattern recursively in dir
grep -r '[pattern]' dir

#Find all instances of file
locate [file]

#Show possible locations of app
whereis [app]

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值