1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Linux TOTD for June 30th

Discussion in 'Linux / Unix Discussion' started by Phoenix, Jun 30, 2004.

  1. Phoenix
    Honorary Member

    Phoenix 53656e696f7220 4d6f64

    5,726
    175
    221
    I have decided to move to a tip of the day rather than a question of the day, this will help to increase your knowledge of commonly required tasks :)

    if you have any specific request for a tip PM me and i will see what I can do, if i dont know exactly it will give me an oppertunity to learn it :)


    anyway, todays Tip of the day

    Common Linux File Management

    Moving a File
    localhost# mv /startdir/startfile /finishdir/finishfile

    Making a Directory
    localhost# mkdir /path/newdirname

    Copying a File
    localhost# cp /origdir/origfile /dupedir/dupefile

    Renaming a File
    localhost# mv /dir/filename /dir/filename2


    Examples

    Moving /usr/storage/new/movieA.avi to the movies directory
    localhost# mv /usr/storage/new/movieA.avi /usr/storage/movies/movieA.avi

    Renaming a file to a useful name (including spaces)
    localhost# mv /usr/storage/movies/movieA.avi /usr/storage/movies/"Spiderman 2 (DVD Rip).avi"

    Making a Dir called confs in our home dir to copy config files before editing
    localhost# mkdir /home/rcoates/confs
    localhost# mkdir ~/confs

    Copying a config file before editing, to ensure you have a backup
    localhost# cp /etc/httpd/conf/httpd.conf /home/rcoates/confs/httpd.orig.conf
    localhost# cp /etc/httpd/conf/httpd.conf ~/confs/httpd.orig.conf


    ~ is a special character indicating your home directory, this is a handy shortcut in alot of file management as generally as a user you primarily have access to only your home dir
     
    Certifications: MCSE, MCITP, VCP
    WIP: > 0
  2. tripwire45
    Honorary Member

    tripwire45 Zettabyte Poster

    13,493
    179
    287
    Good man, Phoenix. Thanks. :)
     
    Certifications: A+ and Network+
  3. tripwire45
    Honorary Member

    tripwire45 Zettabyte Poster

    13,493
    179
    287
    As I dimly recall, the mv common can either move or rename a file. If the filename already exists, the mv common simply moves the file. If the filename doesn't exist, using mv creates the file then moves your data into it. How's that?
     
    Certifications: A+ and Network+
  4. Phoenix
    Honorary Member

    Phoenix 53656e696f7220 4d6f64

    5,726
    175
    221
    Im going to change this to a weekly or bi weekly thread rather than daily
    partly due to slow interest in linux in general, and the fact i am still a learner and do not have years of material to put into the tips :)
     
    Certifications: MCSE, MCITP, VCP
    WIP: > 0
  5. nugget
    Honorary Member

    nugget Junior toady

    7,796
    71
    224
    Sorry Phoenix, I haven't had much time for Linux lately due to SuSE 9.1 not living up to expectations but I hope to get back to it very soon. Keep up the tips and info though, it's really good and might stimulate others into action too.:D
     
    Certifications: A+ | Network+ | Security+ | MCP (270,271,272,290,620) | MCDST | MCTS:Vista
    WIP: MCSA, 70-622,680,685

Share This Page

Loading...