Exercise: Create Files (I/O Redirection)

  • Make your home directory your current working diretory (“Change into your home directory”)

  • From there, fill the directory hierarchy from Exercise: mkdir with files

    • Create a file hello in the parent directory, containing a single line, hello sweetheart

    • Create a file business-card in the child directory, containing four lines

      • Your first name

      • Your last name

      • Your street (including number)

      • Your ZIP code and city

Hint

You use the >> operator to append a line to an existing file (or to create that file if it doesn’t exist:

$ echo 8020 Graz >> somefile.txt
cluster_linux Linux cluster_linux_basics Linux Basics cluster_linux_basics_shell The Shell (Bash - “Bourne Again Shell”) cluster_linux_basics_shell_exercises The Shell - Exercises cluster_linux_basics_shell_exercises_cp_mv_mkdir_rm Exercises: Create/Copy/Move/Remove cluster_linux_basics_intro Introduction: Concepts and Terminology linux_basics_shell_cwd Current Working Directory linux_basics_shell_commandline Commandline linux_basics_shell_cwd->linux_basics_shell_commandline linux_basics_shell_paths Absolute and Relative Paths linux_basics_shell_cwd->linux_basics_shell_paths linux_basics_intro_process Processes, Scheduling, Address Spaces linux_basics_shell_cwd->linux_basics_intro_process linux_basics_intro_overview Overview linux_basics_shell_commandline->linux_basics_intro_overview linux_basics_shell_file_dir_create_rm Creating And Removing Files and Directories linux_basics_shell_file_dir_create_rm->linux_basics_shell_cwd linux_basics_shell_file_dir_create_rm->linux_basics_shell_paths linux_basics_shell_paths->linux_basics_shell_commandline linux_basics_shell_exercises_cp_mv_mkdir_rm_echo_create_files Exercise: Create Files (I/O Redirection) linux_basics_shell_exercises_cp_mv_mkdir_rm_echo_create_files->linux_basics_shell_cwd linux_basics_shell_exercises_cp_mv_mkdir_rm_echo_create_files->linux_basics_shell_file_dir_create_rm linux_basics_shell_exercises_cp_mv_mkdir_rm_echo_create_files->linux_basics_shell_paths linux_basics_shell_exercises_cp_mv_mkdir_rm_mkdir_p_rm_r Exercise: mkdir linux_basics_shell_exercises_cp_mv_mkdir_rm_echo_create_files->linux_basics_shell_exercises_cp_mv_mkdir_rm_mkdir_p_rm_r linux_basics_shell_exercises_cp_mv_mkdir_rm_mkdir_p_rm_r->linux_basics_shell_cwd linux_basics_shell_exercises_cp_mv_mkdir_rm_mkdir_p_rm_r->linux_basics_shell_file_dir_create_rm linux_basics_intro_process->linux_basics_intro_overview