Copying/deleting files, folders

  1. How to edit a file
    If you want to edit a file with the program Gedit, do as follows at the terminal
    \framebox{
\texttt{
\textcolor{red}{\bf gedit FILENAME.EXTENTION}
}
}

    Notice, that if FILENAME.EXTENTION  does not exist, it will be created, otherwise will open that file.

  2. How to delete a folder/file
    A folder is deleted using \framebox{
\texttt{
\textcolor{red}{\bf rm -rf FOLDERNAME}
}
} and a file is deleted with
    \framebox{
\texttt{
\textcolor{red}{\bf rm FILENAME.EXTENTION}
}
}

  3. Move (or Rename) Files and Directories
    \framebox{
\texttt{
\textcolor{red}{\bf mv src-file dest-file}
}
}    rename src-file to dest-file
    \framebox{
\texttt{
\textcolor{red}{\bf mv src-file dest-dir}
}
}    move a file into a directory
    \framebox{
\texttt{
\textcolor{red}{\bf mv src-dir dest-dir}
}
}    rename src-dir, or move to dest-dir
    \framebox{
\texttt{
\textcolor{red}{\bf mv -i src dest}
}
}    copy & prompt before overwriting

  4. Copy Files
    \framebox{
\texttt{
\textcolor{red}{\bf cp src-file dest-file}
}
}    copy src-file to dest-file
    \framebox{
\texttt{
\textcolor{red}{\bf cp src-file dest-dir}
}
}    copy a file into a directory
    \framebox{
\texttt{
\textcolor{red}{\bf cp -R src-dir dest-dir}
}
}    copy one directory into another
    \framebox{
\texttt{
\textcolor{red}{\bf cp -i src dest}
}
}    copy & prompt before overwriting



Webmaster: Christian E. Salas Eljatib, E-mail: christian.salas@yale.edu