System Information Commands |
|
uname -a |
shows Linux system info |
uname -r |
shows kernel release info |
cat /etc/redhat-release |
shows installed redhat version |
uptime |
displays system running/life time |
hostname |
shows system host name |
hostname -I |
shows ip addresses of the host |
last reboot |
displays system reboot history |
date |
displays current date and time |
cal |
displays monthly calendar |
mount |
shows mounted filesy-stems |
|
|
User Information Commands |
|
id |
shows user&group ids of the current
user |
last |
shows the last users logged on |
whoami |
shows who you are logged in as |
who |
shows who is logged into the system |
w |
shows who is logged in and what they do |
groupadd test |
creates group “test” |
useradd -c “GK” -m Gokhan |
creates “Gokhan” account with comment “GK” |
userdel Gokhan |
deletes account “Gokhan” |
usermod -aG
Networkers Gokhan |
adds account “Gokhan” to the “Networkers”
group |
File Commands |
|
ls -l |
shows file type and access permission |
ls -a |
lists also hidden files |
ls -al |
lists files and directories details |
pwd |
shows present directory |
mkdir directory |
creates a directory |
rm xyz |
deletes file xyz |
rm -r /xyz |
deletes directory /xyz and its contents recursively |
rm -f abc |
forcefully deletes abc file without confirmation |
rm -rf /xyz |
forcefully deletes directory /xyz recursively |
cp aaa bbb |
copies aaa file to bbb
file |
cp -r /xxx /yyy |
copies /xxx directıry to /yyy directory |
mv aaa bbb |
renames or moves file aaa to file bbb |
touch abc |
creates an empty file named abc |
cat abc |
used to view file abc |
less abc |
browse through a text file abc |
head abc |
displays first 10 lines of file abc |
tail abc |
displays last 10 lines of file abc |
tail -f abc |
displays last 10 lines of file abc and follow it as it grows |
tail -F abc |
outputs last lines of abc as it changes |
file abc |
gets type of abc |
gpg -c abc |
encrypts file abc |
gpg abc |
decrypts file abc |
dir |
shows files in the current directory |
put abc |
uploads file ‘abc’ from local to remote device |
get file |
downloads file ‘abc’ from remote to local device |
File Permission |
|
chown user |
changes ownership of a file/directory |
chown user:group
filename |
changes user and group for a file or directory |
File Permissions
|
r (read) permission, 4 |
w (write) permission, 2 |
|
x (execute) permission, 1 |
|
-= no permission |
|
File Owner |
owner/group/everyone |
File Permissions Examples |
777 | Owner, Group, Everyone has rwx
permissions |
744 | Owner has rwx permission, Group,
Everyone has r permission |
|
755 | Owner has rwx permission, Group,
Everyone has rx permissions |
|
776 | Owner, Group has rwx permission,
Everyone has rw |
|
File Owner |
owner/group/everyone |
|
|
ls Options |
|
-a |
shows all (including hidden) |
-R |
recursive list |
-r |
reverse order |
-t |
sort by last modified |
-S |
sort by file size |
-l |
long listing format |
-m |
comma--separated output |
-Q |
quoted output |
All UNIX commands for SDET and Manual tester Part-3
No comments:
Post a Comment