Dev C%2b%2b Commands List

Posted on by

This process is relatively easy as long as you know what Dev-C requires to do this. In this page you will be given instructions using the Project menu choice. In another handout you will be given instructions on how to manually compile, link and execute C files at the command prompt of a command window. Step 1: Configure Dev-C.

This article provides practical examples for 50 most frequently used commands in Linux / UNIX.

This is not a comprehensive list by any means, but this should give you a jumpstart on some of the common Linux commands. Bookmark this article for your future reference.
Did I miss any frequently used Linux commands? Leave a comment and let me know.

1. tar command examples

Create a new tar archive.

Command line arguments are passed to the main function. We should pass command line arguments when the program is invoked or executed. Command line arguments control the program from outside as we pass the arguments through the command line. In this tutorial, we have seen the command line arguments of C. C: Variables and Constants Variables are an extremely core concept to most object orientated programming languages. I like to visualize a variable much like a box. We can put things in the box, we can take things out of the box, and at any point we can see what is inside the box. C Program to Access Elements of an Array Using Pointer; C Program to Swap Numbers in Cyclic Order Using Call by Reference; C Program to Find the Frequency of Characters in a String; C Program to Find the Number of Vowels, Consonants, Digits and White Spaces in a String; C Program to Remove all Characters in a String Except Alphabets. Command Specifies a DevCon command. For information about the available DevCon commands and the command arguments, use the following list. You can also get syntax help in a Command Prompt window using DevCon help command. To list and display information about devices on the computer, use the following commands: DevCon HwIDs. Command Description dev.god true/false: Allows the player to fly. Dev.time 0-24: Set day time to specified number. 0 to 24 (In hours). Help list help command list - Shows you a list of available commands command - For a description of a certain command fps true fps false: Shows FPS Counter on the right side of the screen clear: Clears your. Summary of basic C-commands Compiling To compile a C-program, you can use either gor c. G -oexecutable lename.out source lename.cc c -oexecutable lename.out source lename.cc For the following commands you can nd at the end of this summary sample programs. Each command in C is followed by;'. Carriage return has no meaning in C.

Extract from an existing tar archive.

Dev C 2b 2b Commands List Command

View an existing tar archive.

More tar examples: The Ultimate Tar Command Tutorial with 10 Practical Examples

2. grep command examples

Search for a given string in a file (case in-sensitive search).

Print the matched line, along with the 3 lines after it.

Search for a given string in all files recursively

More grep examples: Get a Grip on the Grep! – 15 Practical Grep Command Examples

3. find command examples

Find files using file-name ( case in-sensitve find)

Execute commands on files found by the find command

Find all empty files in home directory

More find examples: Mommy, I found it! — 15 Practical Linux Find Command Examples

4. ssh command examples

Login to remote host

Debug ssh client

Display ssh client version

More ssh examples: 5 Basic Linux SSH Client Commands

5. sed command examples

When you copy a DOS file to Unix, you could find rn in the end of each line. This example converts the DOS file format to Unix file format using sed command.

Print file content in reverse order

Add line number for all non-empty-lines in a file

More sed examples: Advanced Sed Substitution Examples

6. awk command examples

Remove duplicate lines using awk

Print all lines from /etc/passwd that has the same uid and gid

Print only specific field from a file.

More awk examples: 8 Powerful Awk Built-in Variables – FS, OFS, RS, ORS, NR, NF, FILENAME, FNR

7. vim command examples

Go to the 143rd line of file

Go to the first match of the specified

Open the file in read only mode.

More vim examples: How To Record and Play in Vim Editor

8. diff command examples

Ignore white space while comparing.

More diff examples: Top 4 File Difference Tools on UNIX / Linux – Diff, Colordiff, Wdiff, Vimdiff

9. sort command examples

Sort a file in ascending order

Sort a file in descending order

Sort passwd file by 3rd field.

10. export command examples

To view oracle related environment variables.

To export an environment variable:

11. xargs command examples

Copy all images to external hard-drive

Search all jpg images in the system and archive it.

Download all the URLs mentioned in the url-list.txt file

12. ls command examples

Display filesize in human readable format (e.g. KB, MB etc.,)

Order Files Based on Last Modified Time (In Reverse Order) Using ls -ltr

Visual Classification of Files With Special Characters Using ls -F

More ls examples: Unix LS Command: 15 Practical Examples

13. pwd command

pwd is Print working directory. What else can be said about the good old pwd who has been printing the current directory name for ages.

14. cd command examples

Use “cd -” to toggle between the last two directories

List

Use “shopt -s cdspell” to automatically correct mistyped directory names on cd

More cd examples: 6 Awesome Linux cd command Hacks

Commands

15. gzip command examples

To create a *.gz compressed file:

To uncompress a *.gz file:

Display compression ratio of the compressed file using gzip -l

16. bzip2 command examples

To create a *.bz2 compressed file:

To uncompress a *.bz2 file:

More bzip2 examples: BZ is Eazy! bzip2, bzgrep, bzcmp, bzdiff, bzcat, bzless, bzmore examples

17. unzip command examples

To extract a *.zip compressed file:

View the contents of *.zip file (Without unzipping it):

18. shutdown command examples

Shutdown the system and turn the power off immediately.

Shutdown the system after 10 minutes.

Reboot the system using shutdown command.

Force the filesystem check during reboot.

19. ftp command examples

Both ftp and secure ftp (sftp) has similar commands. To connect to a remote server and download multiple files, do the following.

To view the file names located on the remote server before downloading, mls ftp command as shown below.

More ftp examples: FTP and SFTP Beginners Guide with 10 Examples

20. crontab command examples

View crontab entry for a specific user

Schedule a cron job every 10 minutes.

More crontab examples: Linux Crontab: 15 Awesome Cron Job Examples

21. service command examples

Service command is used to run the system V init scripts. i.e Instead of calling the scripts located in the /etc/init.d/ directory with their full path, you can use the service command.

Check the status of a service:

Check the status of all the services.

Restart a service.

22. ps command examples

ps command is used to display information about the processes that are running in the system.

While there are lot of arguments that could be passed to a ps command, following are some of the common ones.

To view current running processes.

To view current running processes in a tree structure. H option stands for process hierarchy.

23. free command examples

Dev C 2b 2b Commands List Cheat

This command is used to display the free, used, swap memory available in the system.

Typical free command output. The output is displayed in bytes.

If you want to quickly check how many GB of RAM your system has use the -g option. -b option displays in bytes, -k in kilo bytes, -m in mega bytes.

If you want to see a total memory ( including the swap), use the -t switch, which will display a total line as shown below.

24. top command examples

top command displays the top processes in the system ( by default sorted by cpu usage ). To sort top output by any column, Press O (upper-case O) , which will display all the possible columns that you can sort by as shown below.

To displays only the processes that belong to a particular user use -u option. The following will show only the top processes that belongs to oracle user.

More top examples: Can You Top This? 15 Practical Linux Top Command Examples

25. df command examples

Displays the file system disk space usage. By default df -k displays output in bytes.

df -h displays output in human readable form. i.e size will be displayed in GB’s.

Use -T option to display what type of file system.

26. kill command examples

Use kill command to terminate a process. First get the process id using ps -ef command, then use kill -9 to kill the running Linux process as shown below. You can also use killall, pkill, xkill to terminate a unix process.

More kill examples: 4 Ways to Kill a Process – kill, killall, pkill, xkill

27. rm command examples

Get confirmation before removing the file.

It is very useful while giving shell metacharacters in the file name argument.

Print the filename and get confirmation before removing the file.

Following example recursively removes all files and directories under the example directory. This also removes the example directory itself.

28. cp command examples

Copy file1 to file2 preserving the mode, ownership and timestamp.

Copy file1 to file2. if file2 exists prompt for confirmation before overwritting it.

29. mv command examples

Rename file1 to file2. if file2 exists prompt for confirmation before overwritting it.

Note: mv -f is just the opposite, which will overwrite file2 without prompting.

mv -v will print what is happening during file rename, which is useful while specifying shell metacharacters in the file name argument.

30. cat command examples

You can view multiple files at the same time. Following example prints the content of file1 followed by file2 to stdout.

While displaying the file, following cat -n command will prepend the line number to each line of the output.

31. mount command examples

To mount a file system, you should first create a directory and mount it as shown below.

You can also add this to the fstab for automatic mounting. i.e Anytime system is restarted, the filesystem will be mounted.

32. chmod command examples

chmod command is used to change the permissions for a file or directory.

Give full access to user and group (i.e read, write and execute ) on a specific file.

Revoke all access for the group (i.e read, write and execute ) on a specific file.

Apply the file permissions recursively to all the files in the sub-directories.

More chmod examples: 7 Chmod Command Examples for Beginners

33. chown command examples

chown command is used to change the owner and group of a file.

To change owner to oracle and group to db on a file. i.e Change both owner and group at the same time.

Use -R to change the ownership recursively.

34. passwd command examples

Change your password from command line using passwd. This will prompt for the old password followed by the new password.

Super user can use passwd command to reset others password. This will not prompt for current password of the user.

Remove password for a specific user. Root user can disable password for a specific user. Once the password is disabled, the user can login without entering the password.

35. mkdir command examples

Following example creates a directory called temp under your home directory.

Create nested directories using one mkdir command. If any of these directories exist already, it will not display any error. If any of these directories doesn’t exist, it will create them.

36. ifconfig command examples

Use ifconfig command to view or configure a network interface on the Linux system.

View all the interfaces along with status.

Start or stop a specific interface using up and down command as shown below.

More ifconfig examples: Ifconfig: 7 Examples To Configure Network Interface

37. uname command examples

Uname command displays important information about the system such as — Kernel name, Host name, Kernel release number,
Processor type, etc.,

Sample uname output from a Ubuntu laptop is shown below.

38. whereis command examples

When you want to find out where a specific Unix command exists (for example, where does ls command exists?), you can execute the following command.

When you want to search an executable from a path other than the whereis default path, you can use -B option and give path as argument to it. This searches for the executable lsmk in the /tmp directory, and displays it, if it is available.

39. whatis command examples

Whatis command displays a single line description about a command.

40. locate command examples

Using locate command you can quickly search for the location of a specific file (or group of files). Locate command uses the database created by updatedb.

The example below shows all files in the system that contains the word crontab in it.

41. man command examples

Display the man page of a specific command.

When a man page for a command is located under more than one section, you can view the man page for that command from a specific section as shown below.

Following 8 sections are available in the man page.

  1. General commands
  2. System calls
  3. C library functions
  4. Special files (usually devices, those found in /dev) and drivers
  5. File formats and conventions
  6. Games and screensavers
  7. Miscellaneous
  8. System administration commands and daemons

For example, when you do whatis crontab, you’ll notice that crontab has two man pages (section 1 and section 5). To view section 5 of crontab man page, do the following.

42. tail command examples

Print the last 10 lines of a file by default.

Print N number of lines from the file named filename.txt

View the content of the file in real time using tail -f. This is useful to view the log files, that keeps growing. The command can be terminated using CTRL-C.

More tail examples: 3 Methods To View tail -f output of Multiple Log Files in One Terminal

43. less command examples

less is very efficient while viewing huge log files, as it doesn’t need to load the full file while opening.

One you open a file using less command, following two keys are very helpful.

More less examples: Unix Less Command: 10 Tips for Effective Navigation

44. su command examples

Switch to a different user account using su command. Super user can switch to any other user without entering their password.

Execute a single command from a different account name. In the following example, john can execute the ls command as raj username. Once the command is executed, it will come back to john’s account.

Login to a specified user account, and execute the specified shell instead of the default shell.

45. mysql command examples

mysql is probably the most widely used open source database on Linux. Even if you don’t run a mysql database on your server, you might end-up using the mysql command ( client ) to connect to a mysql database running on the remote server.

To connect to a remote mysql database. This will prompt for a password.

To connect to a local mysql database.

If you want to specify the mysql root password in the command line itself, enter it immediately after -p (without any space).

46. yum command examples

To install apache using yum.

To upgrade apache using yum.

To uninstall/remove apache using yum.

47. rpm command examples

To install apache using rpm.

To upgrade apache using rpm.

To uninstall/remove apache using rpm.

More rpm examples: RPM Command: 15 Examples to Install, Uninstall, Upgrade, Query RPM Packages

48. ping command examples

Ping a remote host by sending only 5 packets.

More ping examples: Ping Tutorial: 15 Effective Ping Command Examples

49. date command examples

Set the system date:

Once you’ve changed the system date, you should syncronize the hardware clock with the system date as shown below.

50. wget command examples

The quick and effective method to download software, music, video from internet is using wget command.

Download and store it with a different name.

More wget examples: The Ultimate Wget Download Guide With 15 Awesome Examples

Did I miss any frequently used Linux commands? Leave a comment and let me know.

> Add your comment

If you enjoyed this article, you might also like..



Next post: Linux modprobe Command Examples to View, Install, Remove Modules

Previous post: Linux Strings Command Examples (Search Text in UNIX Binary Files)

Here are some fundamental and common Linux commands with example usage:

Filesystem

ls

The ls command lists the content of the current directory (or one that is specified). It can be used with the -l flag to display additional information (permissions, owner, group, size, date and timestamp of last edit) about each file and directory in a list format. The -a flag allows you to view files beginning with . (i.e. dotfiles).

cd

Using cd changes the current directory to the one specified. You can use relative (i.e. cd directoryA) or absolute (i.e. cd /home/pi/directoryA) paths.

pwd

The pwd command displays the name of the present working directory: on a Raspberry Pi, entering pwd will output something like /home/pi.

mkdir

You can use mkdir to create a new directory, e.g. mkdir newDir would create the directory newDir in the present working directory.

rmdir

To remove empty directories, use rmdir. So, for example, rmdir oldDir will remove the directory oldDir only if it is empty.

rm

Dev C 2b 2b Commands List Download

The command rmremoves the specified file (or recursively from a directory when used with -r). Be careful with this command: files deleted in this way are mostly gone for good!

cp

Using cp makes a copy of a file and places it at the specified location (this is similar to copying and pasting). For example, cp ~/fileA /home/otherUser/ would copy the file fileA from your home directory to that of the user otherUser (assuming you have permission to copy it there). This command can either take FILE FILE (cp fileA fileB), FILE DIR (cp fileA /directoryB/) or -r DIR DIR (which recursively copies the contents of directories) as arguments.

mv

The mv command moves a file and places it at the specified location (so where cp performs a 'copy-paste', mv performs a 'cut-paste'). The usage is similar to cp. So mv ~/fileA /home/otherUser/ would move the file fileA from your home directory to that of the user otherUser. This command can either take FILE FILE (mv fileA fileB), FILE DIR (mv fileA /directoryB/) or DIR DIR (mv /directoryB /directoryC) as arguments. This command is also useful as a method to rename files and directories after they've been created.

touch

The command touch sets the last modified time-stamp of the specified file(s) or creates it if it does not already exist.

cat

You can use cat to list the contents of file(s), e.g. cat thisFile will display the contents of thisFile. Can be used to list the contents of multiple files, i.e. cat *.txt will list the contents of all .txt files in the current directory.

head

The head command displays the beginning of a file. Can be used with -n to specify the number of lines to show (by default ten), or with -c to specify the number of bytes.

tail

The opposite of head, tail displays the end of a file. The starting point in the file can be specified either through -b for 512 byte blocks, -c for bytes, or -n for number of lines.

chmod

You would normally use chmod to change the permissions for a file. The chmod command can use symbols u (user that owns the file), g (the files group) , and o (other users) and the permissions r (read), w (write), and x (execute). Using chmod u+x *filename* will add execute permission for the owner of the file.

chown

The chown command changes the user and/or group that owns a file. It normally needs to be run as root using sudo e.g. sudo chown pi:root *filename* will change the owner to pi and the group to root.

ssh

ssh denotes the secure shell. Connect to another computer using an encrypted network connection.For more details see SSH (secure shell)

scp

The scp command copies a file from one computer to another using ssh.For more details see SCP (secure copy)

sudo

The sudo command enables you to run a command as a superuser, or another user. Use sudo -s for a superuser shell.For more details see Root user / sudo

dd

The dd command copies a file converting the file as specified. It is often used to copy an entire disk to a single file or back again. So, for example, dd if=/dev/sdd of=backup.img will create a backup image from an SD card or USB disk drive at /dev/sdd. Make sure to use the correct drive when copying an image to the SD card as it can overwrite the entire disk.

df

Use df to display the disk space available and used on the mounted filesystems. Use df -h to see the output in a human-readable format using M for MBs rather than showing number of bytes.

unzip

The unzip command extracts the files from a compressed zip file.

tar

Use tar to store or extract files from a tape archive file. It can also reduce the space required by compressing the file similar to a zip file.

To create a compressed file, use tar -cvzf *filename.tar.gz* *directory/*To extract the contents of a file, use tar -xvzf *filename.tar.gz*

pipes

A pipe allows the output from one command to be used as the input for another command. The pipe symbol is a vertical line . For example, to only show the first ten entries of the ls command it can be piped through the head command ls head

tree

Use the tree command to show a directory and all subdirectories and files indented as a tree structure.

&

Run a command in the background with &, freeing up the shell for future commands.

wget

Download a file from the web directly to the computer with wget. So wget https://www.raspberrypi.org/documentation/linux/usage/commands.md will download this file to your computer as commands.md

curl

Use curl to download or upload a file to/from a server. By default, it will output the file contents of the file to the screen.

man

Show the manual page for a file with man. To find out more, run man man to view the manual page of the man command.

Search

grep

Use grep to search inside files for certain search patterns. For example, grep 'search' *.txt will look in all the files in the current directory ending with .txt for the string search.

The grep command supports regular expressions which allows special letter combinations to be included in the search.

awk

awk is a programming language useful for searching and manipulating text files.

find

The find command searches a directory and subdirectories for files matching certain patterns.

whereis

Use whereis to find the location of a command. It looks through standard program locations until it finds the requested command.

Networking

ping

The ping utility is usually used to check if communication can be made with another host. It can be used with default settings by just specifying a hostname (e.g. ping raspberrypi.org) or an IP address (e.g. ping 8.8.8.8). It can specify the number of packets to send with the -c flag.

nmap

nmap is a network exploration and scanning tool. It can return port and OS information about a host or a range of hosts. Running just nmap will display the options available as well as example usage.

hostname

The hostname command displays the current hostname of the system. A privileged (super) user can set the hostname to a new one by supplying it as an argument (e.g. hostname new-host).

ifconfig

Dev C 2b 2b Commands List Pdf

Use ifconfig to display the network configuration details for the interfaces on the current system when run without any arguments (i.e. ifconfig). By supplying the command with the name of an interface (e.g. eth0 or lo) you can then alter the configuration: check the manual page for more details.