Linux Commands

From The Dubins
Jump to: navigation, search
    RM Command Safety
    remap the rm command to be 'rm -i'   
    Do this by editing the .profile with:  alias rm='rm -i' 

To check RedHat installation version: cat /etc/redhat-release

To cd or change to a directory with spaces in the path, use "double quotes around the entire target path "

Do copy a folder to a new folder in the same path:

Suppose you are at /home/someplace/ and you want to copy /home/someplace/SourceFolder to a new folder, to the following at /home/someplace/

cp -r SourceFolder NewDestinationFolder

To copy all the files in a directory to a new directory, enter:

    cp -R * /new/file/location

To check memory usage on the server:


cat /proc/meminfo

free -m

   vi removing trailing blanks workaround
   cut -c1-40 m3a.cvs > m3aclean.cvs
   vi searching
   (shift + colon, then)
   cat file1 file2 file3 > file4
   This command combines the contents of the first three files into the fourth file.
   Network and IP configuration:
   ps -ef | grep STUFF-U-WANT
   Find out which directories have the most stuff in them
   du -ks * | sort -nr
   Basic VI Commands
    What shell am I using?
    ps -p$$
    echo $SHELL
    ps -ef | grep somthing
    lsof | grep something

Check the space used on the hard disks: df -h for human

use 'set -o vi' if your previous command is not working or backspace is not working. f

Here's a script to use for checking if process are running. It's instead of ps.

   if  -z $1 ;
       print 'usage: chk <include> <exclude>'
   if  -z $2 ;
   if ps -aef|grep $1|grep -v 'grep'|grep -v 'ps -aef';
      return 0
      return 1
   ps -aef|grep $1|grep -v $2|grep -v 'grep'|grep -v 'ps -aef';

Fedora Mirrors

Yum Update Fedora Core