Linux commands - need a reminder?

Discussion in 'Linux Discussion' started by Adam B, May 5, 2008.

  1. Adam B Guest

    Adam B
    Studying for midterm, and just needed a reminder of some linux commands that i havent used in months:

    1) Remove all files in current working directory that end in .bak
    2) Count the number of files and directories in the parent directory of the current directory
  2. RideYukon164 Guest

    rm ./*.bak

    ls ../ | wc

    ./ just means the current directory
    ../ means the directory immediately above.
  3. prd_muslim Guest

    hope this will help you .
    I dont really know much about linux command or programming and design but have my reasons lol
  4. wondering Guest

    1) rm *.bak (this will work if you are in the directory you want to remove the files from ) otherwise use

    rm /dir1/dir2//dir3/*.bak

    2) ls -lr | wc -l

    ls -lr gives the long listing which is piped to the wc command ,wc -l counts the number of lines ..hwoever to count the files in the parent directory you have to navigate the parent directory or do something like this

    ls -lr /dir1/dir2/ | wc -l

Share This Page