LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-27-2013, 04:33 PM   #1
rnicksy
LQ Newbie
 
Registered: Feb 2013
Posts: 1

Rep: Reputation: Disabled
create a calendar and file in one command


using mkdir to create new file how do i add a cal command to get a calendar in the file all in one command without using pipes
 
Old 02-27-2013, 04:51 PM   #2
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142
mkdir doesn't create a file, it creates a directory (hence the name, make-directory = mkdir)

Code:
cal > file
would do it without pipes
 
Old 02-27-2013, 06:32 PM   #3
codergeek
Member
 
Registered: Dec 2012
Posts: 52

Rep: Reputation: 7
Also, if you want a full year calendar

cal 2013 > file

For more cal options type man cal
 
1 members found this post helpful.
Old 02-27-2013, 07:56 PM   #4
shivaa
Senior Member
 
Registered: Jul 2012
Location: Grenoble, Fr.
Distribution: Sun Solaris, RHEL, Ubuntu, Debian 6.0
Posts: 1,800
Blog Entries: 4

Rep: Reputation: 286Reputation: 286Reputation: 286
Quote:
Originally Posted by rnicksy View Post
using mkdir to create new file how do i add a cal command to get a calendar in the file all in one command without using pipes
Command mkdir is not a file creation command but it creates a new empty directory. See:
Code:
~$ man mkdir
In order to get calander in a file with file creation, as already said above, just do:
Code:
~$ cal [option] > filename
OR
~$ cat filename; cal [option] > filename
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to create a script to add sed command into a file Runicer Programming 4 04-08-2012 03:00 PM
Using dd command to create a .sequence file zeus65 Linux - Newbie 4 10-05-2009 04:38 AM
how do i create an empty bash(.sh) file in command line? bbmak Linux - Newbie 1 10-26-2007 02:39 AM
create linked file by command ,how ? silvercloud General 1 09-07-2005 07:38 AM
how to create the .profile file.what command?thanks:) kenisalen Linux - Newbie 1 11-06-2002 09:57 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:32 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration