[笔记]Linux常用命令行

ls
directory listing
ls -l
long listing, display file ownersship
ls -la
display hidden files/directories

cd directory
cd /
cd ~
change directory

whoami
displays your logged in user id
 
mv [source_file] [target_file]

rm myfile
removes a file
rm -rf mydirectory/
removes a directory, recursively

pwd
prints working directory
the full path name

ln -s directory1 /usr/local/bin/npm
create soft link

which docker
which top
where is the executable located
/usr/bin/docker
/usr/bin/top

top
what is eating your cpu

ps -ef
displays informantion about a selection of the active process

ssh
secure shell, an encrypted network protocol allowing for remote login and command execution
an “ssh.exe” is also available via Cygwin as well as with a git installation
attention:on Windows:putty、winscp
 
 who
display the user online's tty or pts
 

netstat -nultp

查看当前所有已经使用的端口情况

netstat -anp |grep 82

查看82端口的使用情况

netstat –an

查看当前打开的端口

 

查看Linux的系统信息

hostname

查看机器名

mksxy.centos

uname –a

查看系统内核

Linux mksxy.centos 2.6.32

cat /etc/centos-release

查看操作系统的版本

centos release 6.6

ifconfig

查看网络配置信息

当前有三个网卡:eth0,eth1,eth2,lo;

其中lo的ip是127.0.0.1,是用于测试的虚拟接口

fdisk –l

查看磁盘信息

df –h

查看磁盘信息

filesystem

/dev/sda2

tmpfs

/dev/sda1

/dev/sda5

cat /proc/cpuinfo

查看cpu的信息

cat /proc/meminfo

查看内存信息

 

  没有英汉互译结果
   请尝试网页搜索

猜你喜欢

转载自www.cnblogs.com/hoanfir/p/9096526.html