Hello there! If you are new here, you might want to subscribe to the RSS feed to receive updates.
I’m going to assume that you know how to do some basic stuff in Linux. In other words, if you don’t know what a command line is, or how to traverse directories, this might not help you much.
I should also note that my preferred flavor of Linux is Ubuntu. These commands will work on Ubuntu, but I can’t make any guarantees for other distributions. Best to just try them out and see what happens!
Without further ado, here are some more of the top linux tips and tricks that I have gathered over the years…
Show current Ubuntu version:
lsb_release -aCount number of files in the current directory:
ls -1 | wc -lFind files edited in last 1 day in the current directory:
find ./ -ctime -1 -printEmpty a file’s contents of all but the last 5 lines:
tail -5 file.nam > file.namTruncate a file to zero length:
:>filenameShow version/dependency info for a given [package name]:
dpkg -s [package name]/mysqlSee what installed packages still have stuff pointing to a location such as /etc/mysql:
dpkg -S etc/mysqlSet time, data, and timezone:
Set the time zone:dpkg-reconfigure tzdatadate MMDDHHMMYYYY.SShwclock --utc --systohcfdisk -lhdparm -i /dev/sda
(substitute
Show partition info (UUID, TYPE, etc.):/dev/XXX for /dev/sda)blkidThat’s it for this round. Have fun!






0 comments:
Post a Comment