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

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

as: command not found

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

If you encounter the below error while running the as command:

as: command not found

you may try installing the below package as per your choice of distribution:

OS Distribution Command
OS X brew install binutils
Debian apt-get install binutils-i586-linux-gnu
Ubuntu apt-get install binutils-2.26
Alpine apk add binutils
Arch Linux pacman -S aarch64-linux-gnu-binutils
Kali Linux apt-get install binutils-i686-kfreebsd-gnu
CentOS yum install binutils
Fedora dnf install binutils-arc-linux-gnu
Raspbian apt-get install binutils-mingw-w64-i686

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. nginx 504 gateway time-out
  2. postfix: command not found
  3. How to Delete the Files Which are Older Than n Days WITHOUT Using find Command
  4. rm: cannot remove ‘doc/by-app’: Function not implemented (CentOS/RHEL 7)
  5. hcitool: command not found
  6. lvmdump Command Examples in Linux
  7. How to configure Linux Resource Groups (cgroups) for MySQL
  8. startkde: command not found
  9. CentOS / RHEL 7 : How to install kernel from rescue mode
  10. mocp: command not found

You May Also Like

Primary Sidebar

Recent Posts

  • powertop Command Examples in Linux
  • powertop: command not found
  • powerstat: command not found
  • powerstat Command Examples in Linux

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright