• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • VCS
  • Interview Questions
  • Database
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

as Command Examples in Linux

by admin

“as” is a command in Linux that stands for “assembler.” It is a program that converts assembly language code (a low-level programming language) into machine code that can be executed by a computer.

To use the “as” command, you need to provide it with the name of an assembly language source file as an argument. For example, to assemble a file called “program.s”, you can use the following command:

# as program.s

This will create an object file called “program.o” that contains the machine code version of the assembly language program. You can then use the “ld” (linker) command to combine the object file with other object files and libraries to create an executable file.

For example, to create an executable file called “program” from the object file “program.o”, you can use the following command:

# ld program.o -o program

as Command Examples

1. Assemble a file, writing the output to a.out:

# as file.s

2. Assemble the output to a given file:

# as file.s -o out.o

3. Generate output faster by skipping whitespace and comment preprocessing. (Should only be used for trusted compilers):

# as -f file.s

4. Include a given path to the list of directories to search for files specified in .include directives:

# as -I path/to/directory file.s

Filed Under: Linux

Some more articles you might also be interested in …

  1. jstack Command Examples
  2. hashcat: command not found
  3. What is ioremap()
  4. git apply: Apply a patch to files and/or to the index
  5. lorem Command Examples
  6. ceph: command not found
  7. reflector Command Examples in Linux
  8. clifm: The command line file manager
  9. UbuntuDDE new upcoming Linux distribution
  10. checkupdates : Command Examples in Linux

You May Also Like

Primary Sidebar

Recent Posts

  • Vanilla OS 2 Released: A New Era for Linux Enthusiasts
  • mk Command Examples
  • mixxx Command Examples
  • mix Command Examples

© 2025 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright