View Full Version : A piece of Linux command a day...
oreoboy
12-10-2003, 01:14 PM
hhehehe... just to make this linux forum more happening.. provide us a piece of command each time you read this topic...
Let me start first.. Alamak.. I am a dummy in linux.. i just know...
ls - to list all file and directory in current directory... betul ke?
bachok83
12-10-2003, 01:45 PM
hahahaha nice...
locate filename - is used when you want to find file named filename
cp filename /path/ - is used to copy file to folder /path/
remember, there is no dir command in linux... (i got infected by a virus once, the ls command cannot be used, but dir simply replace the task.. what a tragedy :P)
littlebigone
12-10-2003, 02:42 PM
mv path1/filename path2/filename can be used to rename or move files where path1 is your source and path2 is your destination
bachok83
12-10-2003, 04:05 PM
what was rename command againt?? i forgot LOL
masterof_none
12-10-2003, 10:45 PM
rename command is
mv old_filename new_filename
the same command for moving files across directories.
oreoboy
12-10-2003, 11:23 PM
can i ask....?
what is chmod for?
masterof_none
12-10-2003, 11:30 PM
chmod is used to change the file permission
in unix, every file has permission. To look at the file permission at a particular directory, use :
ls -l
you will see sth like this :
rwx--x-wx stuff.c
r = read,
w = write
x = execute.
chmod can change those permissions .
also, you can type man chmod for details.
masterof_none
13-10-2003, 12:02 AM
you can use one of these 2 ways:
1. use the digit that represent the permission,
e.g
chmod 777 stuff.c
would let every user read, write and execute.
Those digits, 7, represent different permissions.
2. use the alphabet.
e.g chmod a+rwx stuff.c
a =all (user),
irfanz
13-10-2003, 08:30 AM
ps aux
lists all processes and their PID, owner, percentage of memory used, percentage of CPU used... handy when you have processes that eat up resources to kill
just type
kill PID
littlebigone
13-10-2003, 10:53 AM
ooohh...thanks...tahts a good one.
masterof_none
13-10-2003, 10:35 PM
cd - change directory
e.g :
cd recom
go to directory recom.
or, we can use full path :
cd /stuff/recom
recom directory resides inside stuff.
we must remember that UNIX directory start from root , /
or, go up
cd .. (don't forget the space .)
or go to home directory:
cd (without any parameter)
or go to some directory under home :
cd ~/recom
littlebigone
13-10-2003, 11:47 PM
i use this when I'm programming. Say I want to open an editor an still be able to use the same terminal:
emacs <filename> &
it works when you open any application but I think it's most useful when you program so you can compile and run without having to close the editor or use another terminal
bachok83
14-10-2003, 12:52 AM
can somebody post here how to use vi ...
i think i love vi better, but i dunno how to use it...
littlebigone
14-10-2003, 03:44 AM
emacs has games
masterof_none
08-11-2003, 12:15 AM
emacs has games/? teach me how to get it.
(and whenever possible , port it to vi ;-) )
littlebigone
08-11-2003, 12:45 AM
can't remember but i think it's something on the menu at the top, maybe under tools. but i know you can run the games from terminal too
ma256
25-11-2003, 05:56 AM
run /sbin/ifconfig
it works the same way ipconfig works in DOS
vseehua
22-02-2006, 06:26 AM
it's been quite a while since the last linux commands are given out...hehe...let me add a few commands so that everyone can benefit from it
su:
this will be the command to temporarily enable you to have administrator priviledges (read : linux admin = root)..
to use, just type in the command and input the root password
sudo
this command does just abt the same thing as su, but the difference will be, this command will give you root priviledge, run and command and then immediately exits from the root mode...
syntax sudo <your_command_here>
then input your root password...people who are dealing with root-login-disabled distros will have to deal with this command most of the time they are using the terminal :) (eg : most natably Ubuntu, Knoppix, Gentoo...)
mount
this will mount any drives (or partitions) you have as a folder in the filesystem tree
i'll give the syntax later...hehe..me blur blur 1..cn't remember properly...or anyone can can help me out?
rm
well, what does the command reads like to you there??
it means remove...and this commands will delete files from the system via the terminal..
syntax rm <your_file_name>
hyperair
23-05-2010, 06:17 PM
du - Disk Usage
This command can be used to query and report the disk usage of files and folders recursively if needed. It reports sizes in kibibytes by default, but can be changed using "-h" for human-readable, "-b" for bytes, "-m" for mebibytes, and other custom block sizes using --block-size=<number, with optional prefix>, so -m is equivalent to --block-size=1M
df - Disk Free
This command shows you the free disk space for all mounted volumes. The accepted flags are similar to du. If passed a file, it will show the disk space available on the volume that contains the specified file.
syntax: df <files>
man - Manual page
With this you can read a manual page of almost any command on your Linux system, and even the API reference for some functions in C libraries.
syntax: man <command>
By the way, emacsclient rocks :-)
vseehua
23-05-2010, 06:26 PM
Tip for those who reads a man page but don't know how to get out:
Pressing "Q" will take you back to the terminal. (just found out about this a few weeks ago :P)
youngyew
23-05-2010, 06:33 PM
This has got to be the most widely spaced thread ever. #17 and #18 are separate by 2 years, #18 and #19 are 4 years. :D
hyperair
24-06-2010, 02:16 AM
We should rename the thread to "A linux command every few years" ;-)
vBulletin® v3.7.6, Copyright ©2000-2012, Jelsoft Enterprises Ltd.