Thursday, August 27, 2015

RHEL - Commands you should master

lp print

ls list

pwd Present Working Directory

cat Views file

more Displays text file one screen at a time

file Displays file type

less Displays file with scroll and search capability

date Displays or changes system date

system-config-date Opens a GUI tool to Display or change system date

passwd Changes password

id [username] Displays user and group information for specified username

su - username Switches user while keeping environmental variables

su username Switches user without environmental variables

su - Switches to root user

exit Exits su to original user

chage Sets password age limit

whoami Shows original user id logged in as

groups Shows group memberships for each username

history Shows commands entered since login

!# Enters command with command history number #

!A Enters last command with the first letter A

[partial command] TAB TAB Displays commands similar to partial command entered

bg Runs a process ID in the background

fg Runs a process ID in the foreground

ctrl Z Breaks or pauses a process

ctrl C Kills a process

jobs Shows jobs running on machine

ctrl-alt-f5 Switches to virtual console 5

ctrl-alt-f1 Returns to GUI from virtual console

virt-manager Opens a GUI tool for virtual machine manager

echo $PATH Displays path of commands used

echo $ Displays environmental variable value or prints script info to user screen

cd Changes directory

cp Copies files

ln Creates a hard link

ln -s Creates a symbolic link or alias

mv Moves a file

rm Removes a file or directory

touch Creates or updates access and modification times of a file

mkdir Creates a directory

rmdir Removes an empty directory

alias Creates a command alias in .bashrc file

reset Clears terminal log history and terminal window

clear Clears terminal window but not log

where is Locates executable command paths

locate Searches for a file path in nightly indexed file database

updatedb Creates or updates the indexed file database used by locate command

find Searches for a file in a directory hierarchy

system-release Displays RedHat Version information

nano Text editor and file creator

gedit Opens a GUI text editor

man Opens a manual page for a command

man -k Suggests manual page similar to text entered

makewhatis Updates man database after packet installation

pinfo Advanced lynx based viewer for commands info page or its manual page if one does not exist

firefox Opens a GUI web browser

sudo Allows a user to execute a command at another users access level

lpadmin Configures a printer

lp [filename] Prints filename to default printer

palimpsest Opens a GUI disk utility

fdisk Mbr disk partitioner

df -h Shows mapping of disk partitions

mount Mounts a directory as a partition

umount Unmounts a directory as a partition

pvcreate Creates a logical physical volume

pvdisplay Displays logical physical volumes

vgcreate Creates a volume group from physical volume physical extents

vgdisplay Displays volume groups

lvcreate Creates a logical volume made of physical extents

lvdisplay Displays logical volumes

mkfs Formats a partition and creates a filesystem

vgextend Extends a volume group to a new partition

resize2fs Extends a logical volume group filesystem

lsblk Displays overview of partitions and logical volumes

kill -l Displays a list of process signals

kill Sends a signal to a process

nice Runs a command with a modified niceness scheduling priority

renice Alters the niceness scheduling priority of a process

top Opens command line process manager

ps Displays processes running from current window

ps -e Displays every process running on system

du Displays disk usage

du -sh Displays total disk usage of all directorys under current directory

yum Yellowdog updater modified package manager

rpm Redhat package manager

Package manager that does not resolve dependencies Rpm package manager

Package manager that does resolve dependencies Yum package manager

createrepo Creates yum repository

system-config-network Opens a GUI for configuring network interfaces

arp Modify the system arp cache

ip Displays IP address and network information similar to ifconfig

ifconfig Displays IP address and network information similar to ip

route Displays or modifies routing table of system

iproute Second way to display routing table of system

netstat -r Display only routing table of system

host Simple DNS hostname or IP look up tool based on the same engine as DIG

nslookup Older DNS lookup tool that queries it's own DNS table before contacting a DNS server and then showing IP and Host as well as the lookup server

hostname Displays or nonpersistantly modifies hostname entry in /proc/sys/kernel/hostname

service network restart Restarts network services with new settings

dig In depth DNS lookup utility similar to host that gives entire DNS message

tail Displays last ten lines of a file

chsh Changes shell

chage Changes password aging similar to passwd-x or usermod

passwd -x Changes password aging similar to chage or usermod

usermod Changes user attributes

useradd Adds a user to passwd but will not assign a password

groupadd Adds a group to groups or directory

chown Changes user ownership of a file or directory

chmod Changes mode of a file

chgrp Changes group ownership of a file or directory

ssh Opens a secure shell terminal

scp Secure copies a file

rsync Syncs remote files to local files

ssh-keygen Generates, manages, and converts authentication keys for ssh

ssh-copy-id Installs ~/.ssh/id_rsa.pub in a remote machines ~/.ssh/authorized_keys file

file-roller Opens a GUI archive manager

chkconfig Displays or modifies services run at boot

vncpasswd Sets your VNC password on the VNC server

vncviewer Opens a GUI VNC window

getsebool Displays SE Linux variables

iptables Sets up, maintains, and inspects the tables of IP packet filter rules in the linux kernel (firewalls)

seinfo Queries SE linux policy

getenforce Displays SE linux status

setenforce Changes SE linux status

restorecon Restores SE linux file context based on dir it is in

chcon Changes SE linux file context

tune2fs Displays or modifies tunable filesystem parameters on ext filesystems

blkid Displays or modifies block id attributes of disks

setfacl Sets file access control lists

swapon Enables a swap partition

swapoff Disables a swap partition

uname -r Displays currently running kernel

cat /proc/cmdline Displays arguments passed to kernel at boot

init Sets init runlevel for next boot

runlevel Displays previous and current system runlevel

umask Sets file mode creation mask for files and directories

tar Creates a tar file

gpg Encryption and signing tool allowing private key use to run scripts

service Displays status, starts, stops, or restarts a system init script

ftp Opens text based ftp client

sealert Opens a GUI SE linux browser and troubleshooter

grep flags /proc/cpuinfo Displays processor stats

virsh Creates a virtual machine

lvrename Renames a logical volume

lvremove Removes a logical volume

ctrl - Decreases font size

ctrl + Increases font size

vim Opens a text editor similar to vi

squid Proxy caching server

partprobe Informs kernel of partition table changes to nonprimary partions

kpartx Creates device maps from partition tables

w Displays currently logged in users

last Displays last lines of a file or log

makewhatis Creates or renews man -k database

wc Displays word count on a file

sort Sorts lines in a file for output

unique Displays non adjacent unique lines in a file

tee Reads from standard input and writes to a file

e2label Changes label on ext partition

cryptsetup Encrypts a partition

reboot Restarts system

mkswap Create a linux swap area in a file or partition

lvm Open text based logical volume manager

info Displays Info pages of a command

dmsetup Low level logical volume manager

vgreduce Shrinks a volume group by removing a physical volume from it.

fsck Checks and repairs the health of an unmounted filesystem

pvs Checks available extents in a physical volume

pvmove Moves data off a physical volume that is to be removed.

lvreduce Shrinks a logical volume to a defined size

lvextend Extends a logical volume to a defined size or by a defined amount

showmount Displays the mount information for an NFS server

smbclient Samba ftp client to access SMB/CIFS resources on servers

service autofs reload Reinitializes autofs after updating /etc/auto.master

userdel Removes a user from /etc/passwd file

groupdel Removes a group from /etc/groups file

vipw Locks the passwd file and opens it for editing user information

vigr Locks the groups file and opens it for editing group information

pwconv Syncs the /etc/shadow and /etc/passwd files

pwchk Checks the /etc/passwd file for errors

automount manages autofs mount points

system-config-users Opens a GUI tool for managing users and groups

autoconfig Opens a TUI interface for managing NIS, LDAP, Kerberos 5, and SMB, by editing the /etc/sysconfig/network, /etc/passwd, and /etc/shadow files.

system-config-authentication Opens a GUI tool for managing NIS, LDAP, Kerberos 5, and SMB, by editing the /etc/sysconfig/network, /etc/passwd, and /etc/shadow files.

getent Searches a given database file like passwd, group, aliases, shadow, etc.. for a defined term and returns matching entries

getfacl Displays file acl for provided file path

grpconv Syncs /etc/group and /etc/gshadow files

newgrp Changes group id to a named group. Similar su - command for changing users.

gpasswd Sets group password in /etc/gshadow

wget Non-Interactive file downloader that allows a user to retrieve a file while not logged in. Designed to work over slow or unstable network connections.

ps -eZ Displays SE linux information for processes

semanage fcontext Displays SE linux defaults used by restorecon

setsebool Sets specific SE linux rules on or off

lsof Displays list of files opened by system

nc Opens netcat utility for troubleshooting tcp/udp connections

service rsyslog restart Restarts log server after changes to rsyslog.conf

logger Sends a test message to the log server

logwatch Monitors logs and emails a summary to root

killall Kills all processes with a specific name

crontab Configures cron files in the /var/spool/ directory used by the crond process

anacron Similar to cron, it runs commands listed in the /etc/anacrontab file based on date it was last run, so cron commands are not missed in the event of a system being shut down.

dmesg Displays boot messages from the kernel ring buffer /proc/ksmsg

sysctl Configures kernel parameters for next boot cycle

modinfo Displays information about a kernel module

lsmod Displays what modules are loaded by kernel

modprobe Adds or removes modules from the kernel

No comments:

Post a Comment