Skip to content

Solve a shell script where i have to delete the files with size 0?

I have to delete with permission the files with size 0 created by a user from a certain path. The user and the path are positional parameters. i thought of making a “for” where i go through the files from a certain user and then with “find” to remove the ones empty from the wanted path…

Read last line of file after the file was modified

I have a problem with reading the last line of file in Linux Ubuntu. I have a file named auth.log and I’m trying to read it last line after new line was added (after file was modified). I know i need to use tail -1 /var/log/auth.log to get last line but I don’t know how to check the file every

rename files which produced by split

I splitted the huge file and output is several files which start by x character. I want to rename them and make a list which sorted by name like below: part-1.gz part-2.gz part-3.gz … I tried below CMD: for (( i = 1; i <= 3; i++ )) ;do for f in `ls -l | awk ‘{print $9}’ | grep