Welcome Guest ( Log In | Register )

Outline · [ Standard ] · Linear+

 Any interesting commands in Linux?

views
     
ceciliatang95
post Oct 18 2021, 08:36 AM

Getting Started
**
Junior Member
67 posts

Joined: Oct 2021


Hi~

Thanks for the input here forumers.
I just started Linux myself, here are some useful ones:

CODE
df -h

For revealing disk space and usage, pretty useful if for server admins.
Make sure check out the /var/logs, majority of the legacy server at my company has /var/logs of 2GB

CODE
du -s

Check the file usage of your current folder

CODE
cd -

Change directory to your previous directory. Say if you were at /home/foo/bar and then cd to /var/log/audit, you can use cd - to instantly return to /home/foo/bar/

CODE
truncate -s (number) (size) (file)

Truncate a file size, useful if the Linux cannot even use rm -rf due to full disk space.
Sample: truncate -s 10k app.log

Hope it helps.

 

Change to:
| Lo-Fi Version
0.0150sec    0.47    6 queries    GZIP Disabled
Time is now: 28th March 2024 - 04:11 PM