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. Similar Threads: Linux commands
    Forum Title Date
    Linux Discussion Can i use the ubuntu linux commands on windows XP? Sep 11, 2008
    Linux Discussion How do I run multiple commands on a Unix/Linux system without a GUI? Jul 3, 2008
    Linux Discussion Any links to get demos of running Linux commands using Terminal!? Jun 11, 2008
    Linux Discussion Linux commands? May 7, 2008
    Linux Discussion Linux Commands? May 5, 2008
    Linux Discussion Linux Commands? May 5, 2008
    Linux Discussion LInux commands? May 5, 2008
    Linux Discussion linux commands? May 5, 2008
    Linux Discussion Linux Commands? May 4, 2008
    Linux Discussion linux commands help? May 4, 2008

  3. RideYukon164 Guest

    RideYukon164
    rm ./*.bak

    ls ../ | wc


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

    prd_muslim
    http://www.oreillynet.com/linux/cmd/
    hope this will help you .
    I dont really know much about linux command or programming and design but have my reasons lol
  5. wondering Guest

    wondering
    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