Commands every IT tech should know

linux commands:

 

List of open files:

lsof

List of open files deleted

lsof | grep deleted

Kill process to remove locked / opened deleted fill

kill #

 

Finddisk usage

df -h

Find Size of folders in current directory

du -sh *

 

logging server:

/etc/init.d/rsyslog

 

networking;

/etc/init.d/networking

 

List files (attributes, list, human readable)

ls -alh

 

Remove files from a system

rm filename

Remove Directory with files in it and all subdirectory

rm -rf directory/

 

You can use * to select multiple directories or files

rm -rf temp*

will delete all temp files containing temp and folders, ex temp123, or folder temp_dir

Using these commands via terminal it will bypass any trashcan.

 

Catalog or view a file | show it page by page with more

cat /path/to/somefile.txt | more

 

Terminal file editors:

nano

vi

vim

 

Graphical file editors:

gedit

kate

gmacs

emacs

 

Download FIles:

wget http://sample.com/filetodownload.tar

 

Syning Files:

rsync

 

Tar

How to open or Untar a “tar” or” tar.gz” file in Linux or Unix:

  1. From the terminal, change to the directory where yourfile.tar has been downloaded.
  2. Type tar -zxvf yourfile.tar to extract the file to the current directory.
  3. Or tar -C /myfolder -zxvf yourfile.tar to extract to another directory.

 

list installed packages files (Red hat, Centos, Fedora)  this can help you find config files for a certian package

rpm -ql (package) | grep /etc

 

Windows / DOS

Navigating the command prompt

 

The /s will delete all subdirectories

Prior to XP deltree

XP – Vista rmdir /s

Windows 7 -8 – rm /s

Article by Bizanator

I'm a security researcher, pentester and general IT guru professionally since 2003. While IT and security has been a habit of mine, literally learning my ABCs on an Apple IIe I have worked on virtually every operating system in the past 25 years. Learning about memory manipulation starting in the early Blizzard days I found an affinity in security and exploit development. My career has allowed me to work in a variety of industries and have been a strong supporter of open source and virtualization. My goal here is to provide a forum of information where when you're brain dead hopefully myself or one of our members can work together in the spirit of open source and resolving those brain dead moments. You can request a consultation with me on Maven.

Leave a Reply

Your email address will not be published. Required fields are marked *