Created
May 17, 2020 00:17
-
-
Save thieu1995/3de1b1ee4d66cc5c4b797fc431c2f430 to your computer and use it in GitHub Desktop.
List of useful command line in linux
This file contains 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
# Remove files/folders | |
rm -rfv folder | |
rm file_* # *: pattern | |
rm -v folder/* # Remove all child file in that folder | |
# Determine file size, all file size in folder | |
du -sh foldername/filenames | |
# Watch GPU memory usage in linux | |
watch -d -n 1 nvidia-smi | |
# Get list of process running on core | |
ps -A -o pid,psr,args #(pid - core - command line) | |
ps -A -o psr,pid,args | grep '^ *1' #(core - pid - command line) --> Get list of process running on this core | |
# Copy folder in real, not linked | |
cp -r path1 path2 | |
# Cound number of lines in filer/file in folder | |
wc -l filename/folder_name | |
# scp server to server | |
scp -r source_path_file/folder ip_address/name:path_to_file/folder | |
# scp multiple files in folder without overwrite --> sync between 2 folder | |
rsync -au source_path_folder ip_address/server_name:path_to_folder | |
rsync -a --ignore-existing source_path_folder ip_address/server_name:path_to_folder | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment