![]() ![]() If the directory doesn’t exist we are going to display the directory that doesn’t exist. ![]() echo is just like a print statement it is used to display things on the screen. After that, we are displaying that the files have been successfully deleted using the echo command.rm (remove) is used to delete the files/folder. If the directory exists then we are going to use the looping statement ( for loop) to iterate over files and check their size using -size 0, if the file is zero-sized then we enter the loop and remove the file using the rm command.Here we are using if statement with the -d flag it will return true if the directory exists. To check if the directory name entered by the user really exists, we are using the if statement.Firstly we are taking the directory name as input from the user using the read command.Use for loop to traverse each file and check their size.Input directory name and check if the directory exists in the current folder/directory.How to Hack WPA/WPA2 WiFi Using Kali Linux?.Mutex lock for Linux Thread Synchronization.SORT command in Linux/Unix with examples.AWK command in Unix/Linux with examples.Sed Command in Linux/Unix with examples.ISRO CS Syllabus for Scientist/Engineer Exam.ISRO CS Original Papers and Official Keys.GATE CS Original Papers and Official Keys.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |