Bash Shell Script for Beginner From ServerGyan

Publicado em: 13 Novembro 2018
no canal de: Server Gyan
1,527
43

In this video, I am going to expalin how to use for loop for changing extention of multiple files in any directory or multiple sub directory. this will help you in daily admin task and in interview as well.
Below example will rename all files with .txt extention to .html

for i in `find /tmp/scripts/ -name "*.txt" | cut -d "." -f1`; do mv $i.html $i.htm; done

Below is list of command which you can use to write shell scripts
ls - list directory contents
pwd - print name of current/working directory
cd - change working directory
pushd/popd - put working directory on a stack
file - determine file type
locate - find files by name
updatedb - update database for locate
which - locate a command
history - display bash command history

GETTING HELP

whatis - display the on-line manual descriptions
apropos - search the manual page names and descriptions
man - an interface to the on-line reference manuals

WORKING WITH FILES

mkdir - create a directory/make directories
touch - change file timestamps/create empty files
cp - copy files and directories
mv - move (rename) files
rm - remove files or directories
rmdir - remove empty directories

TEXT FILES

cat - concatenate files and print on the standard output
more/less - file perusal filter for crt viewing
nano - command line text editor

USERS

sudo - execute a command as superuser
su - change user ID or become another user
users - print the user names of users currently logged in
id - print real and effective user and group IDs

CHANGING FILE PERMISSIONS

chmod - change permissions of a file

KILLING PROGRAMS AND LOGGING OUT

Ctrl+C - kill a running command
killall - kill processes by name
exit - log out of bash

USEFUL SHORTCUTS

Ctrl+D - signal bash that there is no more input
Ctrl+L - redraw the screen
Ctrl++ - make text bigger in terminal emulator
Ctrl+- - make text smaller in terminal emulator


Nesta página do site você pode assistir ao vídeo on-line Bash Shell Script for Beginner From ServerGyan duração hora minuto segundo em boa qualidade , que foi baixado pelo usuário Server Gyan 13 Novembro 2018, compartilhe o link com seus amigos e conhecidos, no youtube este vídeo já foi visto 1,527 vezes e gostou 43 espectadores. Boa visualização!