Solved

New to UNIX

Posted on 2009-04-11
2
218 Views
Last Modified: 2013-12-16
Im trying to learn UNIX so Im starting off with a small exercise.

1. Create a directory for each week of the a month called week1, week2, week3 and week4

2. Change the working directory to week1 and create a file called budget that contains food, cable, mortgage, car each on a separate line

3. Sort this file and append the results to the same file

4. Append the results of the pwd command to the file

Im OK with doing steps 1 and 2 but Im confused on steps 3 and 4.

Any help would be great!
0
Comment
Question by:-CyberIT-
2 Comments
 
LVL 4

Accepted Solution

by:
ewest02 earned 50 total points
ID: 24123016
Basically for (3) and (4)

sort file > tmp.file
cat tmp.file >> file
pwd >> file

Voila.

">"  redirects standard out to the target file ; and will create or overwrite that target
">>"  is the append operator. It will _not_ overwrite the target

  --Eric

0
 

Author Closing Comment

by:-CyberIT-
ID: 31569206
That did the trick.  Thanks so much!
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

FreeBSD on EC2 FreeBSD (https://www.freebsd.org) is a robust Unix-like operating system that has been around for many years. FreeBSD is available on Amazon EC2 through Amazon Machine Images (AMIs) provided by FreeBSD developer and security office…
Every server (virtual or physical) needs a console: and the console can be provided through hardware directly connected, software for remote connections, local connections, through a KVM, etc. This document explains the different types of consol…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now