Rogers WP Site of Stuff
Linux useful commands
Sudo passwd “user id”
| Ls -s | Show file Size |
| Ps – aux who | Show users against process’s files open Shows What users are currently logged in and what time the logged in at |
| Ps -ef | grep “service” | Show process running with “service name” |
| Ps -e -f Command 1 | command 2 Grep processname | list processes Show all processes, not just those belonging to user Show processes in full format (more detailed then default) Pass output of command 1 as input to command 2 Find lines containing a pattern The pattern for grep to search the output of ps -ef |
| cat /proc/version | Show what version of Linux you are running |
| Crontab -l | Show cron jobs scheduled on the device |
| Ls -l | List file details incl date |
| Ls -la | Shows swap files in a given directory for any open files via vi |
| Free | Memory Allocation and how much is free |
| Ls -a | Show hidden Directory’s (beginning with a .) |
| Pwd | Show path you are currently in |
| Df – h | Partitions and there Size |
| Grep -R | To search for text in all Directorys from Base Directory |
| E.g grep -R “snmp-server host” /home/rtrmgmt/rtrinfo/switches | |
| ~ | Tilda (used in front of a directory when you don’t know where it is |
| Mtr | Linux Ping /Tracert utility (mytraceroute) “mtr x.x.x.x” where x is ip |
| grep -v | means show all lines not matching. |
| grep -L | means show all FILENAMES not matching |
| grep -R -L “snmp-server host” /home/rtrmgmt/rtrinfo/switches/ |grep running.txt | |
| service –status-all | List running Services |
| service httpd status | Print Status of any service (replace httpd with service name) |
| chkconfig –list | List All Known Services |
| sudo su – dzdo su – | Another method to change into root profile As of 2018 in Centrify use this instead of sudo |
| ls -lrt ~crojas | List files in a particular home directory |
| xzfgrep | Grep inside a .xz archive without uncompressing |
| Man | Manual then follow by the command you want information on |
| Snmpwalk | snmpwalk -c citcowan -v1 atl0navpn01.routers.citco.com system |
| ps -ef |grep -i lof | Shows Process and its associated PID if still running |
| Kill ***** | Where ***** is the PID (will kill the service use -9 to force kill , use with caution |
| Ls -lsa | So date time of file last modified and file permissions |
| Df -k | Display File System |
| /srv/tftpboot | TFTP Directory in Linux |
| ntpq -p | Show the NTP time source and if in sync |
| Passwd | Change your password in Linux |
| Passwd “username” | As Root change a usernames password |
| chown | Change ownership of Directory / File |
| Chmod | Change rights of Directory / File |
| usermod -a -G wheel xxx | Add an existing user to the wheel group (xxx is user id) |
| snmpwalk -c citcowan -v2c atl0fwprd03a 1.3.6.1.4.1.25461.2.1.2 | |
| dzinfo rojones | Run as run on any centryfy box to verify access for that user acount |
Comments are closed.