Revanth Vermareddy
Bash Commands to Remember
🔗Common bash commands to remember at one place
-
Change the server language to English:
export LC_ALL=C
-
Look at the username for of who is running a process on a multi-user server:
ps -u -p <PROCESS_ID>
-
Re-authenticate with github after your PAT has expired:
gh auth login -h [github.com](http://github.com/)
-
Pip install without clogging the cache dir, add a
--no-cache-dir
flag to your pip install commands. -
Create a virtual environment with the below command.
python -m venv <path_to_the_environment>
-
Run a python script with nohup and pipe the output to a file.
nohup python my_script_is_the_best.py &> my_scripts_output.out 2>&1 &
-
Batch convert wav files to mp3 files with ffmpeg -
for f in _.{wav,WAV}; do ffmpeg -i "$f" -c:a libmp3lame -q:a 2 "${f%._}.mp3"; done
-
Append a prefix to specific files in a directory -
for f in {0,1,2,3,4,5}.mp3; do mv "$f" "GAN_$f"; done