Welcome To My Blog
here i will try to collect as much as i can of articles and
toutorials talking about linux and open source software

if you want to share me this and be an author Contact me
subscribe to RSS or subscribe to Email Newsletter

10 Useful Linux Commands

Posted by Linux4all Tuesday, January 12, 2010

Buzz It

10 Useful Linux Commands

Here's a list of 10 commands which 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 5 days which 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 which 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.


Output of ps aux | sort -nrk 4 | head


Display the username which is currently logged in

whoami

Show date using format modifiers

date +"%H:%M:%S"

Will output time in format HOUR:MINUTE:SECOND. You can use any format specifiers explained in the man page. The double quotes are required in case you need to use spaces.

Showing date in format month, day year


Show info about a specific user

finger $USER

Output of 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

Insert a module:

modprobe MODULE

Remove a 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.

Blog Widget by LinkWithin
Add to Technorati Favorites
blog comments powered by Disqus
Loading...

BEST WAY TO SAY THANKS

Labels

ubuntu apache mysql backup gnome audio players compile kernel grub restore security themes web hosting 3d games Clonezilla centos cpanel database fun games gmail gzip kernel linux games mod_deflate monitoring tools music making open ssh recovery redhat reinstall grub rsync ssh * Apt-Get * Howto 3d acceleration AMANDA Ardour Bacula Duplicity E-Books Extract files from ISO FlyBack Graphics Card IP Failover and Web Cluste IP Failover and Web Cluster IPv6 Jokosher K9Copy KDE Karmic Linux Linux Set Date and Time Linux Tools Linux backup tools Linux commands Networking Nginx Open VPN Operating system PATH ReZound Remote Desktop Solutions for Linux Reverse Proxy Load Balancer SLAMPP Samba Sweep Time Vault Traverso DAW Ubuntu Tweak Webmin Windows vs Linux antivirus audi studio auto mount bash block ip block users blog editor boot caching check mail dangerous .caution dd deadly commands debian directory listing dns docks dvd easyapache error 18 fedora find fixing partitions table fork() bomb glxinfo hacking handbrake help image initrd install linux iptables jack jaunty lamp ldap lfs linus linux live linux vs windows log mac osx man mod_rewrite mount network boot ntfs open courseware open source books opengl openshot own distro packup php print in linux print over wireless ptr recompile redirect restore disk restore mbr reverse dns rip dvd screen server share desktop speed up linux spf ssmtp stream desktop swatch syslog syslog-ng top toutorials useful applications vi video editor vim vlc vmlinuz wallpapers whm xsplash

Recent Posts

archive

BEST WAY TO SAY THANKS