Last active
March 13, 2023 10:40
-
-
Save Keiku/4e4799dbcb92b214d2f66d579d1668f8 to your computer and use it in GitHub Desktop.
A list of linux commands.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# compress/decompress zip file. | |
zip file.csv.zip file.csv | |
unzip file.csv.zip | |
# compress/decompress gz file. | |
gzip file.csv | |
gzip -d file.csv.gz | |
# compress/decompress bz2 file. | |
bzip2 file.csv | |
bzip2 -d file.csv.bz2 | |
# compress/decompress tar.gz file. | |
tar zcvf file.csv.tar.gz file.csv | |
tar zxvf file.csv.tar.gz | |
# compress/decompress tar.bz2 file. | |
tar jcvf file.csv.tar.bz2 file.csv | |
tar jxvf file.csv.tar.bz2 | |
# compress/decompress 7z file | |
7z a file.7z file1.csv file2.csv | |
7z x file.7z | |
# repair zip file. | |
zip -FF file.zip --output file_repaired.zip | |
# split a file.(output file.aa, file.ab). | |
split -b 100M file.tsv.bz2 file. | |
# conbine some files. | |
cat file.aa file.ab > file.tsv.bz2 | |
# check the process with high memory usage. | |
ps alx | awk '{printf ("%d\t%s\n", $8,$13)}' | sort -nr | head -10 | |
# check the number of cores. | |
cat /proc/cpuinfo | grep -c "processor" | |
# find files and remove them. | |
find ./ -type f -name "*.txt" -print0 | xargs -0 rm |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment