10 Useful Linux Commands
来源:互联网 发布:通信网络测试工程师 编辑:程序博客网 时间:2024/05/07 16:50
Here's a list of 10 commands that may come handy when using the command line in Linux.
Search for all files modified in the last N days containing a specific text in their name
find DIR -mtime -N -name "*TEXT*"
For example:
find ~ -mtime -5 -name "*log*"
will display all the files modified in the past five days that include the text 'log' in their filename.
Determine which processes use the most memory
ps aux | sort -nk 4 | tail
will show the first 10 processes that use the most memory, using ascendant sorting. Alternately:
ps aux | sort -nrk 4 | head
will show the first 10 processes using most memory, using descendent sorting (see Figure 1).
Display the username which is currently logged in
whoami
Show date using format modifiers
date +"%H:%M:%S"
willoutput time in format HOUR:MINUTE:SECOND. You can use any formatspecifiers explained in the man page. The double quotes are required incase you need to use spaces (see Figure 2).
Show info about a specific user
finger $USER
Show disk usage separately for each partition
df -h
The -h switch will tell df to show human-readable sizes (KB, MB, and GB when it is the case)
df -B 1K
will show sizes in kilobytes.
Show which modules are loaded
lsmod
Add or remove a module to/from the Linux kernel
modprobe MODULE
modprobe -r MODULE
Search for a file using locate
locate FILENAME
will search the locate database (created with updatedb) for any path or file which contains FILENAME.
Change the encoding of a text file
iconv -f INITIAL_ENCODING -t DESIRED_ENCODING filename
For example:
iconv -f ISO-8859-16 -t UTF-8 myfile.txt
will change the encoding of myfile.txt from ISO-8859-16 (Romanian) to UTF-8.
This article originally appeared on TuxArena.
- 10 Useful Linux Commands
- Some useful linux commands
- Useful Linux Wireless Commands
- useful linux commands
- some useful Linux commands
- some useful linux commands
- Some useful Linux Commands
- Useful Linux Wireless Commands
- linux useful commands
- The useful commands in linux
- useful linux commands for me
- Useful Linux commands from OSSIE
- 10 Useful Advanced Git Commands
- 20 Useful Commands for Linux Newbies
- 20 Useful Commands for Linux Newbies
- 15 Useful “ifconfig” Commands to Configure Network Interface in Linux
- 15 Useful “ifconfig” Commands to Configure Network Interface in Linux
- 15 Useful “ifconfig” Commands to Configure Network Interface in Linux
- 05年学过java,失败了!现在成功了!
- 又是一天
- Control.Invoke和Control.BeginInvoke简述
- space字符
- 判断一个点是否在面域上(包括在面域的边上),都投影到XY平面上
- 10 Useful Linux Commands
- MFC和ATL版本小小总结
- 判断一个点是否在面域上的边上), double dMinDist = 1;
- Microsoft_Windows_XP_Professional_SP3系统文件夹
- 单片机汇编语言指令
- 函数指针 指向 类成员!
- 如何ComboBox绑定至数据库(轉)
- 不学谷歌
- (原创)VB开发ActiveX OCX控件供Delphi使用时的注意事项